incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 6/6] Added XML representation of IP address
Date Wed, 25 Aug 2010 14:42:30 GMT
---
 server/views/ip_addresses/index.xml.haml |    4 ++++
 server/views/ip_addresses/show.xml.haml  |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 server/views/ip_addresses/index.xml.haml
 create mode 100644 server/views/ip_addresses/show.xml.haml

diff --git a/server/views/ip_addresses/index.xml.haml b/server/views/ip_addresses/index.xml.haml
new file mode 100644
index 0000000..2f4752c
--- /dev/null
+++ b/server/views/ip_addresses/index.xml.haml
@@ -0,0 +1,4 @@
+!!!XML
+%ip_addresses
+  - @elements.each do |c|
+    = haml :'ip_addresses/show', :locals => { :@ip_address => c, :partial => true
}
diff --git a/server/views/ip_addresses/show.xml.haml b/server/views/ip_addresses/show.xml.haml
new file mode 100644
index 0000000..e49493f
--- /dev/null
+++ b/server/views/ip_addresses/show.xml.haml
@@ -0,0 +1,10 @@
+- unless defined?(partial)
+  !!! XML
+%ip_address{ :href => ip_address_url(@ip_address.id), :id => @ip_address.id, :type
=> "#{@ip_address.type}" }
+  %address<
+    =@ip_address.address
+  %state<
+    =@ip_address.state
+  %realm{:href => realm_url(@ip_address.realm_id), :id => @ip_address.realm_id}
+  %actions
+    %link{ :rel => "destroy", :method => "delete", :href => destroy_ip_address_url(@ip_address.id)}
-- 
1.7.2


Mime
View raw message