You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/03/26 13:36:22 UTC

[3/7] git commit: HTML haml templates use local instead of instance variables

HTML haml templates use local instead of instance variables

Signed-off-by: Francesco Vollero <fv...@redhat.com>


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a19b3d1b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a19b3d1b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a19b3d1b

Branch: refs/heads/master
Commit: a19b3d1b54922e282dc6f52585b8da13b1be743c
Parents: b8652ea
Author: Francesco Vollero <fv...@redhat.com>
Authored: Mon Mar 25 17:57:34 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Tue Mar 26 10:49:59 2013 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/collections/images.rb        |    2 +-
 server/lib/deltacloud/collections/instances.rb     |   23 ++++++---
 .../lib/deltacloud/collections/load_balancers.rb   |    2 +-
 .../lib/deltacloud/collections/storage_volumes.rb  |    2 +-
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    3 +-
 server/views/addresses/_address.html.haml          |    6 +-
 server/views/addresses/associate.html.haml         |    6 +-
 server/views/addresses/index.html.haml             |    4 +-
 server/views/addresses/show.html.haml              |   14 +++---
 server/views/api/show.html.haml                    |    2 +-
 server/views/blobs/new.html.haml                   |    2 +-
 server/views/blobs/show.html.haml                  |   16 +++---
 server/views/buckets/index.html.haml               |    2 +-
 server/views/buckets/show.html.haml                |   14 +++---
 server/views/docs/collection.html.haml             |   12 ++--
 server/views/docs/operation.html.haml              |   10 ++--
 server/views/drivers/index.html.haml               |    2 +-
 server/views/error.html.haml                       |    4 +-
 server/views/firewalls/index.html.haml             |    2 +-
 server/views/firewalls/new_rule.html.haml          |    2 +-
 server/views/firewalls/show.html.haml              |   16 +++---
 server/views/hardware_profiles/index.html.haml     |    2 +-
 server/views/hardware_profiles/show.html.haml      |    6 +-
 server/views/images/index.html.haml                |    2 +-
 server/views/images/new.html.haml                  |    4 +-
 server/views/images/show.html.haml                 |   28 +++++-----
 server/views/instance_states/show.html.haml        |    2 +-
 server/views/instances/new.html.haml               |   28 +++++-----
 server/views/keys/index.html.haml                  |    2 +-
 server/views/keys/show.html.haml                   |   20 ++++----
 server/views/load_balancers/index.html.haml        |    2 +-
 server/views/load_balancers/new.html.haml          |    6 +-
 server/views/load_balancers/show.html.haml         |   20 ++++----
 server/views/metrics/index.html.haml               |    2 +-
 server/views/metrics/show.html.haml                |    4 +-
 server/views/realms/index.html.haml                |    2 +-
 server/views/realms/show.html.haml                 |   10 ++--
 server/views/storage_snapshots/index.html.haml     |    2 +-
 server/views/storage_snapshots/show.html.haml      |   12 ++--
 server/views/storage_volumes/attach.html.haml      |    4 +-
 server/views/storage_volumes/index.html.haml       |    2 +-
 server/views/storage_volumes/show.html.haml        |   38 +++++++-------
 42 files changed, 177 insertions(+), 167 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/lib/deltacloud/collections/images.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/images.rb b/server/lib/deltacloud/collections/images.rb
index 687f931..3d59df5 100644
--- a/server/lib/deltacloud/collections/images.rb
+++ b/server/lib/deltacloud/collections/images.rb
@@ -23,7 +23,7 @@ module Deltacloud::Collections
 
     new_route_for :images do
       halt 404 unless params[:instance_id]
-      @instance = Deltacloud::Instance.new( :id => params[:instance_id] )
+      @opts[:instance] = Deltacloud::Instance.new( :id => params[:instance_id] )
     end
 
     collection :images do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/lib/deltacloud/collections/instances.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/instances.rb b/server/lib/deltacloud/collections/instances.rb
index 7ee662d..6038bee 100644
--- a/server/lib/deltacloud/collections/instances.rb
+++ b/server/lib/deltacloud/collections/instances.rb
@@ -22,13 +22,22 @@ module Deltacloud::Collections
     check_features :for => lambda { |c, f| driver.class.has_feature?(c, f) }
 
     new_route_for(:instances) do
-      @instance = Deltacloud::Instance.new( { :id=>params[:id], :image_id=>params[:image_id] } )
-      @image   = driver.image(credentials, :id => params[:image_id])
-      @hardware_profiles = driver.hardware_profiles(credentials, :architecture => @image.architecture )
-      @realms = [Deltacloud::Realm.new(:id => params[:realm_id])] if params[:realm_id]
-      @realms ||= driver.realms(credentials)
-      @firewalls = driver.firewalls(credentials) if driver.class.has_feature? :instances, :firewalls
-      @keys = driver.keys(credentials) if driver.class.has_feature? :instances, :authentication_key
+      @opts = {
+        :instance => Deltacloud::Instance.new(:id=>params[:id], :image_id=>params[:image_id]),
+      }
+      @opts[:image] = driver.image(credentials, :id => params[:image_id])
+      @opts[:hardware_profiles] = @opts[:image].hardware_profiles
+      if params[:realm_id]
+        @opts[:realms] = [ Deltacloud::Realm.new(:id => params[:realm_id]) ] if params[:realm_id]
+      else
+        @opts[:realms] = driver.realms(credentials)
+      end
+      if driver.class.has_feature?(:instances, :firewalls)
+        @opts[:firewalls] = driver.firewalls(credentials)
+      end
+      if driver.class.has_feature?(:instances, :authentication_key)
+        @opts[:keys] = driver.keys(credentials)
+      end
     end
 
     get '/instances/:id/run' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/lib/deltacloud/collections/load_balancers.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/load_balancers.rb b/server/lib/deltacloud/collections/load_balancers.rb
index 7a75c85..9c0a918 100644
--- a/server/lib/deltacloud/collections/load_balancers.rb
+++ b/server/lib/deltacloud/collections/load_balancers.rb
@@ -19,7 +19,7 @@ module Deltacloud::Collections
     set :capability, lambda { |m| driver.respond_to? m }
 
     new_route_for :load_balancers do
-      @realms = driver.realms(credentials)
+      @opts[:realms] = driver.realms(credentials)
     end
 
     collection :load_balancers do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/lib/deltacloud/collections/storage_volumes.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/storage_volumes.rb b/server/lib/deltacloud/collections/storage_volumes.rb
index e02418f..b3a2958 100644
--- a/server/lib/deltacloud/collections/storage_volumes.rb
+++ b/server/lib/deltacloud/collections/storage_volumes.rb
@@ -24,7 +24,7 @@ module Deltacloud::Collections
     new_route_for(:storage_volumes)
 
     get "/storage_volumes/:id/attach_instance" do
-      @instances = driver.instances(credentials)
+      @opts[:instances] = driver.instances(credentials)
       respond_to do |format|
         format.html{ haml :"storage_volumes/attach"}
       end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 32f13b0..7c9b5d3 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -324,10 +324,11 @@ module Deltacloud::Helpers
 
       def new_route_for(route, &block)
         get '/%s/new' % route.to_s do
+          @opts = {}
           instance_eval(&block) if block_given?
           respond_to do |format|
             format.html do
-              haml :"#{route}/new"
+              haml :"#{route}/new", :locals => @opts
             end
           end
         end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/addresses/_address.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/_address.html.haml b/server/views/addresses/_address.html.haml
index 28420a1..4a75311 100644
--- a/server/views/addresses/_address.html.haml
+++ b/server/views/addresses/_address.html.haml
@@ -1,6 +1,6 @@
 %li
-  %a{ :href => address_url(@address.id), :'data-ajax' => 'false'}
+  %a{ :href => address_url(address.id), :'data-ajax' => 'false'}
     %img{ :class => 'ui-link-thumb', :src => '/images/address.png'}
-    %h3= @address.id
+    %h3= address.id
     %span{ :class => 'ui-li-count'}
-      = @address.instance_id ? @address.instance_id : 'Free'
+      = address.instance_id ? address.instance_id : 'Free'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/addresses/associate.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/associate.html.haml b/server/views/addresses/associate.html.haml
index b4fb707..cc8b300 100644
--- a/server/views/addresses/associate.html.haml
+++ b/server/views/addresses/associate.html.haml
@@ -1,12 +1,12 @@
 =header "Associate to instance"
-=subheader @address.id
+=subheader address.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
-  %form{ :action => "#{address_url(@address.id)}/associate", :method => :post}
+  %form{ :action => "#{address_url(address.id)}/associate", :method => :post}
     %div{ 'data-role' => :fieldcontain }
       %label{ :for => :name} Instance:
       %select{:name => 'instance_id'}
         %option
-          - @instances.each do |inst|
+          - instances.each do |inst|
             %option{ :value => inst.id } #{inst.id} - #{inst.name}
     %button{ :type => :submit} Associate

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/addresses/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/index.html.haml b/server/views/addresses/index.html.haml
index 7c72735..c4b2dcb 100644
--- a/server/views/addresses/index.html.haml
+++ b/server/views/addresses/index.html.haml
@@ -5,5 +5,5 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul#address_list{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @elements.each do |address|
-      = haml :"addresses/_address", :locals => { :@address => address, :partial => true }
+    - elements.each do |address|
+      = haml :"addresses/_address", :locals => { :address => address, :partial => true }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/addresses/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/addresses/show.html.haml b/server/views/addresses/show.html.haml
index d4d146c..4883d83 100644
--- a/server/views/addresses/show.html.haml
+++ b/server/views/addresses/show.html.haml
@@ -1,20 +1,20 @@
 =header "Address"
-=subheader @address.id
+=subheader address.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Address
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@address.id
+      %p{ :'data-role' => 'fieldcontain'}=address.id
     %li{ :'data-role' => 'list-divider'} Associated to instance
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@address.instance_id || "Not associated yet"
+      %p{ :'data-role' => 'fieldcontain'}=address.instance_id || "Not associated yet"
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        - if @address.associated?
-          =link_to_action 'Disassociate', "#{address_url(@address.id)}/disassociate", :post
+        - if address.associated?
+          =link_to_action 'Disassociate', "#{address_url(address.id)}/disassociate", :post
         - else
           - if driver.respond_to?(:associate_address)
-            =link_to_action 'Associate...',"#{address_url(@address.id)}/associate", :get
-        =link_to_action "Destroy", destroy_address_url(@address.id), :delete
+            =link_to_action 'Associate...',"#{address_url(address.id)}/associate", :get
+        =link_to_action "Destroy", destroy_address_url(address.id), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/api/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/api/show.html.haml b/server/views/api/show.html.haml
index 57f32b6..60f29ac 100644
--- a/server/views/api/show.html.haml
+++ b/server/views/api/show.html.haml
@@ -22,7 +22,7 @@
 - unless driver.configured_providers.empty?
   %div{ :'data-role' => :footer, :'data-theme' => 'a'}
     %form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
-      - if @driver_name
+      - if driver_name
         %input{ :name => :driver, :type => :hidden, :value => driver.name }/
       %fieldset{ :'data-type' => "horizontal", :'data-role' => "controlgroup", :id => "providers" }
         %select{:name => 'provider', :'data-inline' => 'true', :'data-native-menu' => 'false'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/blobs/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/blobs/new.html.haml b/server/views/blobs/new.html.haml
index 93cd9c7..62f9263 100644
--- a/server/views/blobs/new.html.haml
+++ b/server/views/blobs/new.html.haml
@@ -1,7 +1,7 @@
 =header "Create new blob"
 
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
-  %form{ :action => bucket_url(@bucket_id), :method => :post, :enctype => 'multipart/form-data', "data-ajax" => "false"}
+  %form{ :action => bucket_url(bucket_id), :method => :post, :enctype => 'multipart/form-data', "data-ajax" => "false"}
     %div{ 'data-role' => :fieldcontain }
       %label
         Blob Name:

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/blobs/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/blobs/show.html.haml b/server/views/blobs/show.html.haml
index b037ed8..0a4fefe 100644
--- a/server/views/blobs/show.html.haml
+++ b/server/views/blobs/show.html.haml
@@ -1,31 +1,31 @@
 =header "Blob"
-=subheader @blob.id
+=subheader blob.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Bucket
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@blob.bucket
+      %p{ :'data-role' => 'fieldcontain'}=blob.bucket
     %li{ :'data-role' => 'list-divider'} Content length
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@blob.content_length
+      %p{ :'data-role' => 'fieldcontain'}=blob.content_length
     %li{ :'data-role' => 'list-divider'} Content type
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@blob.content_type
+      %p{ :'data-role' => 'fieldcontain'}=blob.content_type
     %li{ :'data-role' => 'list-divider'} Last modified
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@blob.last_modified
+      %p{ :'data-role' => 'fieldcontain'}=blob.last_modified
     %li{ :'data-role' => 'list-divider'} Content
     %li
-      %a{ :href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content' }="Download"
+      %a{ :href => bucket_url(blob.bucket) + '/' + blob.id + '/content' }="Download"
     %li{ :'data-role' => 'list-divider'} User meta-data
     %li
       %p{ :'data-role' => 'fieldcontain'}
-        - @blob.user_metadata.each do |k,v|
+        - blob.user_metadata.each do |k,v|
           %b #{k} :
           #{v}
           %br
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        =link_to_action 'Delete',bucket_url(@blob.bucket) + '/' + @blob.id, :delete
+        =link_to_action 'Delete',bucket_url(blob.bucket) + '/' + blob.id, :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/buckets/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/buckets/index.html.haml b/server/views/buckets/index.html.haml
index 48dc699..0db02ec 100644
--- a/server/views/buckets/index.html.haml
+++ b/server/views/buckets/index.html.haml
@@ -3,7 +3,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
-    - @buckets.each do |bucket|
+    - elements.each do |bucket|
       %li
         %a{ :href => bucket_url(bucket.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/bucket.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/buckets/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/buckets/show.html.haml b/server/views/buckets/show.html.haml
index 0ea89dc..c440954 100644
--- a/server/views/buckets/show.html.haml
+++ b/server/views/buckets/show.html.haml
@@ -1,23 +1,23 @@
 =header "Bucket"
-=subheader @bucket.id
+=subheader bucket.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@bucket.name
+      %p{ :'data-role' => 'fieldcontain'}=bucket.name
     %li{ :'data-role' => 'list-divider'} Size
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@bucket.size
+      %p{ :'data-role' => 'fieldcontain'}=bucket.size
     %li{ :'data-role' => 'list-divider'}
       Blobs
-    - @bucket.blob_list.each do |blob|
+    - bucket.blob_list.each do |blob|
       %li
-        %a{ :href => bucket_url(@bucket.name) + "/" + blob, :'data-ajax' => 'false'}
+        %a{ :href => bucket_url(bucket.name) + "/" + blob, :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/blob.png'}
           %h3=blob
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        %a{ :href => new_blob_form_url(@bucket), :'data-role' => "button", :'data-ajax' => 'false'} Create new blob...
-        =link_to_action 'Delete bucket', destroy_bucket_url(@bucket.name), :delete
+        %a{ :href => new_blob_form_url(bucket), :'data-role' => "button", :'data-ajax' => 'false'} Create new blob...
+        =link_to_action 'Delete bucket', destroy_bucket_url(bucket.name), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/docs/collection.html.haml
----------------------------------------------------------------------
diff --git a/server/views/docs/collection.html.haml b/server/views/docs/collection.html.haml
index 7485b60..a973b4f 100644
--- a/server/views/docs/collection.html.haml
+++ b/server/views/docs/collection.html.haml
@@ -1,5 +1,5 @@
 =header "Deltacloud API #{settings.version} documentation", :back => 'false'
-=subheader @collection.name.to_s.titlecase
+=subheader collection.name.to_s.titlecase
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
@@ -8,18 +8,18 @@
         Collection description:
     %li
       %br
-      %p{ :'data-role' => 'fieldcontain'}=@collection.description
+      %p{ :'data-role' => 'fieldcontain'}=collection.description
     %li{ :'data-role' => 'list-divider', :'data-divider-theme' => 'a'}
       %h3 Operations:
-    - @operations.keys.sort_by { |k| k.to_s }.each do |operation|
+    - operations.keys.sort_by { |k| k.to_s }.each do |operation|
       %li{ :'data-role' => 'list-divider'}
-        %a{:href => url_for("docs/#{@collection.name.to_s}/#{operation}"), :'data-ajax' => 'false'} #{operation}
+        %a{:href => url_for("docs/#{collection.name.to_s}/#{operation}"), :'data-ajax' => 'false'} #{operation}
       %li
         %br
-        %p=@operations[operation].description
+        %p=operations[operation].description
     %li{ :'data-role' => 'list-divider', :'data-divider-theme' => 'a'}
       %h3 Defined features:
-    - @features.sort_by { |f| f.name.to_s }.each do |feature|
+    - features.sort_by { |f| f.name.to_s }.each do |feature|
       %li{ :'data-role' => 'list-divider'}=feature.name
       %li
         %br

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/docs/operation.html.haml
----------------------------------------------------------------------
diff --git a/server/views/docs/operation.html.haml b/server/views/docs/operation.html.haml
index b63d36c..6baed0b 100644
--- a/server/views/docs/operation.html.haml
+++ b/server/views/docs/operation.html.haml
@@ -1,5 +1,5 @@
 =header "Deltacloud API #{settings.version} documentation", :back => 'false'
-=subheader "#{action_method(@operation.name, @collection.name).to_s.upcase} /api/#{@collection.name}/#{@operation.name}"
+=subheader "#{action_method(operation.name, collection.name).to_s.upcase} /api/#{collection.name}/#{operation.name}"
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
@@ -8,12 +8,12 @@
         Description:
     %li
       %br
-      %p=@operation.description
+      %p=operation.description
 
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider', :'data-divider-theme' => 'a'}
       %h3 Parameters:
-    - @operation.each_param do |p|
+    - operation.each_param do |p|
       %li{ :'data-role' => 'list-divider'}
         =p.name
         %span{ :class => 'ui-li-count'}
@@ -21,8 +21,8 @@
       %li
         %br
         %p=p.description.empty? ? '<strong>FIXME:</strong> No description for this parameter' : p.description
-    - @features.sort { |a,b| a.name.to_s <=> b.name.to_s }.each do |f|
-      - f.decl.operation(@operation.name).each_param do |p|
+    - features.sort { |a,b| a.name.to_s <=> b.name.to_s }.each do |f|
+      - f.decl.operation(operation.name).each_param do |p|
         %li{ :'data-role' => 'list-divider'}
           =p.name
           %span{ :class => 'ui-li-count'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/drivers/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/drivers/index.html.haml b/server/views/drivers/index.html.haml
index 6a9d866..3f8156a 100644
--- a/server/views/drivers/index.html.haml
+++ b/server/views/drivers/index.html.haml
@@ -3,7 +3,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
-    - @drivers.each do |id, details|
+    - drivers.each do |id, details|
       %li
         %a{ :href => driver_url(id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/cloud.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/error.html.haml
----------------------------------------------------------------------
diff --git a/server/views/error.html.haml b/server/views/error.html.haml
index 220a44a..31350dd 100644
--- a/server/views/error.html.haml
+++ b/server/views/error.html.haml
@@ -17,8 +17,8 @@
   %body
     %div{ 'data-role' => :page, :'data-theme' => 'e', :class => :error }
       =header "#{response.status} - #{translate_error_code(response.status)[:message]}"
-      - if @error
-        =subheader @error.message
+      - if err
+        =subheader err.message
       - elsif response.status.to_s =~ /4(\d{2})/
         =subheader request.env['REQUEST_URI']
       = yield

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/firewalls/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/firewalls/index.html.haml b/server/views/firewalls/index.html.haml
index f497b59..5862e4b 100644
--- a/server/views/firewalls/index.html.haml
+++ b/server/views/firewalls/index.html.haml
@@ -5,7 +5,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @firewalls.each do |firewall|
+    - firewalls.each do |firewall|
       %li
         %a{ :href => firewall_url(firewall.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/firewall.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/firewalls/new_rule.html.haml
----------------------------------------------------------------------
diff --git a/server/views/firewalls/new_rule.html.haml b/server/views/firewalls/new_rule.html.haml
index cfa3cef..ecac451 100644
--- a/server/views/firewalls/new_rule.html.haml
+++ b/server/views/firewalls/new_rule.html.haml
@@ -1,7 +1,7 @@
 =header "New firewall rule"
 
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog', :id => "new_rule_form"}
-  %form{ :action => "#{firewall_url(@firewall_name)}/rules", :method => :post,  :'data-ajax' => 'false'}
+  %form{ :action => "#{firewall_url(firewall_name)}/rules", :method => :post,  :'data-ajax' => 'false'}
     %div{ 'data-role' => :fieldcontain }
       %label{ :for => :name} Protocol:
       %input{ :type => :text, :id => :protocol, :name => :protocol, :value => '', :size => 10 }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/firewalls/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/firewalls/show.html.haml b/server/views/firewalls/show.html.haml
index c2fd5d0..c56ce33 100644
--- a/server/views/firewalls/show.html.haml
+++ b/server/views/firewalls/show.html.haml
@@ -1,27 +1,27 @@
 =header "Firewall"
-=subheader @firewall.id
+=subheader firewall.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Identifier
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@firewall.id
+      %p{ :'data-role' => 'fieldcontain'}=firewall.id
     %li{ :'data-role' => 'list-divider'} Description
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@firewall.description
+      %p{ :'data-role' => 'fieldcontain'}=firewall.description
     %li{ :'data-role' => 'list-divider'} Owner
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@firewall.owner_id
+      %p{ :'data-role' => 'fieldcontain'}=firewall.owner_id
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        =link_to_action "Destroy", destroy_firewall_url(@firewall.id), :delete
+        =link_to_action "Destroy", destroy_firewall_url(firewall.id), :delete
 
 =header "Rules", :back => 'false' do
-  %a{ :href => url_for("firewalls/#{@firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
+  %a{ :href => url_for("firewalls/#{firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
-  - @firewall.rules.each do |rule|
+  - firewall.rules.each do |rule|
     %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
       %li{ :'data-role' => 'list-divider'}
         %strong=rule.id
@@ -39,4 +39,4 @@
       %li{ :'data-role' => 'list-divider'} Actions
       %li
         %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-          =link_to_action "Delete", "#{firewall_url(@firewall.id)}/#{rule.id}", :delete
+          =link_to_action "Delete", "#{firewall_url(firewall.id)}/#{rule.id}", :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/hardware_profiles/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/hardware_profiles/index.html.haml b/server/views/hardware_profiles/index.html.haml
index f02cb53..c3c7342 100644
--- a/server/views/hardware_profiles/index.html.haml
+++ b/server/views/hardware_profiles/index.html.haml
@@ -3,7 +3,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview, :'data-inset' => :true }
-    - for profile in order_hardware_profiles(@hardware_profiles)
+    - for profile in order_hardware_profiles(elements)
       %li{ :'data-theme' => 'c'}
         %a{ :href => hardware_profile_url(profile.id)}
           %img{ :class => 'ui-link-thumb', :src => '/images/profile.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/hardware_profiles/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/hardware_profiles/show.html.haml b/server/views/hardware_profiles/show.html.haml
index 3fbb16f..c879779 100644
--- a/server/views/hardware_profiles/show.html.haml
+++ b/server/views/hardware_profiles/show.html.haml
@@ -1,12 +1,12 @@
 =header "Hardware profiles"
-=subheader @hardware_profile.name || @hardware_profile.id
+=subheader hardware_profile.name || hardware_profile.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@hardware_profile.name || @hardware_profile.id
-    - @hardware_profile.each_property do |p|
+      %p{ :'data-role' => 'fieldcontain'}=hardware_profile.name || hardware_profile.id
+    - hardware_profile.each_property do |p|
       %li{ :'data-role' => 'list-divider'} #{p.name.to_s.titlecase}
       %li
         %p{ :'data-role' => 'fieldcontain'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/images/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/images/index.html.haml b/server/views/images/index.html.haml
index adcad43..bb201a3 100644
--- a/server/views/images/index.html.haml
+++ b/server/views/images/index.html.haml
@@ -4,7 +4,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @images.each do |image|
+    - elements.each do |image|
       %li
         %a{ :href => image_url(image.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/image.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/images/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/images/new.html.haml b/server/views/images/new.html.haml
index 263caf2..d2c6256 100644
--- a/server/views/images/new.html.haml
+++ b/server/views/images/new.html.haml
@@ -1,9 +1,9 @@
 =header "Create new image"
-=subheader "#{@instance.id}"
+=subheader "#{instance.id}"
 
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
   %form{ :action => images_url, :method => :post}
-    %input{ :type => :hidden, :name => :instance_id, :value => @instance.id}
+    %input{ :type => :hidden, :name => :instance_id, :value => instance.id}
     %div{ 'data-role' => :fieldcontain }
       %label{ :for => :name} Name:
       %input{ :type => :text, :id => :name, :name => :name, :value => '' }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/images/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/images/show.html.haml b/server/views/images/show.html.haml
index d33b3e7..fab3723 100644
--- a/server/views/images/show.html.haml
+++ b/server/views/images/show.html.haml
@@ -1,40 +1,40 @@
 =header "Image"
-=subheader @image.id
+=subheader image.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@image.name
+      %p{ :'data-role' => 'fieldcontain'}=image.name
     %li{ :'data-role' => 'list-divider'} Description
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@image.description
+      %p{ :'data-role' => 'fieldcontain'}=image.description
     %li{ :'data-role' => 'list-divider'} Owner
     %li
       %p{ :'data-role' => 'fieldcontain'}
-        %a{ :href => images_url + "?owner_id=#{@image.owner_id}"}
-          =@image.owner_id
+        %a{ :href => images_url + "?owner_id=#{image.owner_id}"}
+          =image.owner_id
     %li{ :'data-role' => 'list-divider'} State
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@image.state
-    - if @image.creation_time
+      %p{ :'data-role' => 'fieldcontain'}=image.state
+    - if image.creation_time
       %li{ :'data-role' => 'list-divider'} Creation Time
       %li
-        %p{ :'data-role' => 'fieldcontain'}=@image.creation_time
+        %p{ :'data-role' => 'fieldcontain'}=image.creation_time
     %li{ :'data-role' => 'list-divider'} Root Device Type
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@image.root_type
+      %p{ :'data-role' => 'fieldcontain'}=image.root_type
     %li{ :'data-role' => 'list-divider'} Architecture
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@image.architecture
-    - if @image.hardware_profiles
+      %p{ :'data-role' => 'fieldcontain'}=image.architecture
+    - if image.hardware_profiles
       %li{ :'data-role' => 'list-divider'} Compatible Hardware Profiles
       %li
         %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-          - @image.hardware_profiles.each do |hwp|
+          - image.hardware_profiles.each do |hwp|
             %a{ :href => url_for("hardware_profiles/#{hwp.id}"), :'data-role' => "button", :'data-ajax' => 'false'} #{hwp.name}
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        %a{ :href => url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch...
-        = link_to_action 'Destroy', destroy_image_url(@image.id), :delete
+        %a{ :href => url_for("instances/new?image_id=#{image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch...
+        = link_to_action 'Destroy', destroy_image_url(image.id), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/instance_states/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/instance_states/show.html.haml b/server/views/instance_states/show.html.haml
index 2a94801..2f5b1d6 100644
--- a/server/views/instance_states/show.html.haml
+++ b/server/views/instance_states/show.html.haml
@@ -5,7 +5,7 @@
   %img{ :src => url_for('instance_states?format=png') }
 
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-theme' => 'a'}
-    - @machine.states.each do |state|
+    - machine.states.each do |state|
       %li{ :'data-role' => 'list-divider', :'class' => 'ui-bar-a', :'data-theme' => 'a'}=state
       - if state.transitions.empty?
         %li{ :'data-role' => 'list-divider'} Action

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/instances/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/instances/new.html.haml b/server/views/instances/new.html.haml
index f6f674e..f508e7f 100644
--- a/server/views/instances/new.html.haml
+++ b/server/views/instances/new.html.haml
@@ -1,8 +1,8 @@
 =header "Launch new instance"
-=subheader "#{@image.id}"
+=subheader "#{image.id}"
 
 .hidden_content
-  - @image.hardware_profiles.each do |profile|
+  - hardware_profiles.each do |profile|
     %div{ :'data-role' => :fieldcontain, :id => "hwp_properties_#{profile.name}", :class => 'property_block'}
       - profile.properties.reject { |prop| prop.fixed? }.each do |prop|
         %label{ :for => "#{prop.param}_#{profile.name}", :class => 'ui-input-text' }=prop.name
@@ -19,7 +19,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
   %form{ :action => instances_url, :method => :post, :class => :new_instance, :enctype => 'multipart/form-data', :'data-ajax' => 'false'}
-    %input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
+    %input{ :name => :image_id, :type => :hidden, :value => instance.image_id }/
 
     - if driver.class.has_feature?(:instances, :user_name)
       %div{ 'data-role' => :fieldcontain }
@@ -52,7 +52,7 @@
             %label{ :for => :keyname, :class => 'ui-input-text'} Instance SSH key:
             %select{:name => 'keyname', :'data-native-menu' => "true" }
               %option{ :value => ''} None
-              - @keys.each do |key|
+              - keys.each do |key|
                 %option{ :value => key.id } #{key.id}
 
         - if driver.class.has_feature?(:instances, :register_to_load_balancer)
@@ -60,20 +60,20 @@
             %label{ :for => :load_balancer_id, :class => 'ui-input-text'} Register to loadbalancer:
             %select{:name => 'load_balancer_id', :'data-native-menu' => "true" }
               %option{ :value => ''} None
-              - @load_balancers.each do |load_balancer|
+              - load_balancers.each do |load_balancer|
                 %option{:value => load_balancer.id} #{load_balancer.id}
 
         - if driver.class.has_feature?(:instances, :firewalls)
           %div{ 'data-role' => :fieldcontain }
             %fieldset{ :'data-role' => 'controlgroup'}
               %legend Register to firewall:
-              - @firewalls.each_index do |i|
-                - if @firewalls[i].name == 'default'
-                  %input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :checked => :true, :id => "firewalls#{i}"}/
+              - firewalls.each_index do |i|
+                - if firewalls[i].name == 'default'
+                  %input{:type => :checkbox, :value => firewalls[i].name, :name => "firewalls#{i}", :checked => :true, :id => "firewalls#{i}"}/
                   %label{:for => "firewalls#{i}"} Default
                 - else
-                  %input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :id => "firewalls#{i}"}/
-                  %label{:for => "firewalls#{i}"}=@firewalls[i].name
+                  %input{:type => :checkbox, :value => firewalls[i].name, :name => "firewalls#{i}", :id => "firewalls#{i}"}/
+                  %label{:for => "firewalls#{i}"}=firewalls[i].name
 
         - if driver.class.has_feature?(:instances, :user_files)
           %div{ 'data-role' => :fieldcontain }
@@ -84,21 +84,21 @@
               %input{ :type => :text, :id => "path#{i}", :name => "path#{i}", :value => ""} Path #{i}
               %input{ :type => "file", :name => "content#{i}", :size => 50 }
 
-    - if !@hardware_profiles.empty?
+    - if !hardware_profiles.empty?
       %div{ 'data-role' => :fieldcontain }
         %h3 Instance profile
         %fieldset{ :'data-role' => :fieldcontain}
-          - @hardware_profiles.each do |profile|
+          - hardware_profiles.each do |profile|
             %input{ :type => :radio, :name => 'hwp_id', :value => profile.id, :id => profile.name, :'data-theme' => 'b'}/
             %label{ :for => profile.name, :onclick => "expandHWP('#{profile.name}');"}="#{profile.name} - #{profile.memory} MB"
             %div{ :'data-role' => :fieldcontain, :id => "property_container_#{profile.name}", :class => 'hwp_properties'}
 
-    - if !@realms.empty?
+    - if !realms.empty?
       %div{ 'data-role' => :fieldcontain }
         %h3 Where do you want it?
         %fieldset{ :'data-role' => :fieldcontain}
           %legend
-          - @realms.each do |realm|
+          - realms.each do |realm|
             %div{ :'data-role' => :fieldcontain}
               %label{ :for => realm.id }= "#{realm.name}, #{realm.limit}"
               %input{ :type => :radio, :name => 'realm_id', :value => realm.id, :id => realm.id, :'data-theme' => 'b' }/

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/keys/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/keys/index.html.haml b/server/views/keys/index.html.haml
index 43efd76..ec83f68 100644
--- a/server/views/keys/index.html.haml
+++ b/server/views/keys/index.html.haml
@@ -3,7 +3,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
-    - @elements.each do |key|
+    - elements.each do |key|
       %li
         %a{ :href => key_url(key.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/key.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/keys/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/keys/show.html.haml b/server/views/keys/show.html.haml
index 2b2a11e..bfd8287 100644
--- a/server/views/keys/show.html.haml
+++ b/server/views/keys/show.html.haml
@@ -1,31 +1,31 @@
 =header "Key"
-=subheader @key.id
+=subheader key.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Identifier
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@key.id
+      %p{ :'data-role' => 'fieldcontain'}=key.id
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@key.name
-    - if @key.is_password?
+      %p{ :'data-role' => 'fieldcontain'}=key.name
+    - if key.is_password?
       %li{ :'data-role' => 'list-divider'} Username
       %li
-        %p{ :'data-role' => 'fieldcontain'}=@key.username
+        %p{ :'data-role' => 'fieldcontain'}=key.username
       %li{ :'data-role' => 'list-divider'} Password
       %li
-        %p{ :'data-role' => 'fieldcontain'}=@key.password
+        %p{ :'data-role' => 'fieldcontain'}=key.password
     - else
-      - if @key.fingerprint
+      - if key.fingerprint
         %li{ :'data-role' => 'list-divider'} Fingerprint
         %li
-          %p{ :'data-role' => 'fieldcontain'}=@key.fingerprint
+          %p{ :'data-role' => 'fieldcontain'}=key.fingerprint
       %li{ :'data-role' => 'list-divider'} PEM key
       %li
         %p{ :'data-role' => 'fieldcontain'}
-          %pre{:style=> 'width:600px;overflow:auto;'}=@key.pem_rsa_key
+          %pre{:style=> 'width:600px;overflow:auto;'}=key.pem_rsa_key
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        =link_to_action "Destroy", destroy_key_url(@key.id), :delete
+        =link_to_action "Destroy", destroy_key_url(key.id), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/load_balancers/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/load_balancers/index.html.haml b/server/views/load_balancers/index.html.haml
index 789cd57..8b2f41f 100644
--- a/server/views/load_balancers/index.html.haml
+++ b/server/views/load_balancers/index.html.haml
@@ -4,7 +4,7 @@
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
-    - @elements.each do |balancer|
+    - elements.each do |balancer|
       %li
         %a{ :href => load_balancer_url(balancer.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/balancer.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/load_balancers/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/load_balancers/new.html.haml b/server/views/load_balancers/new.html.haml
index 6dffedd..e3b4016 100644
--- a/server/views/load_balancers/new.html.haml
+++ b/server/views/load_balancers/new.html.haml
@@ -6,18 +6,18 @@
       %label
         Name:
       %input{ :name => 'name', :size => 30 }/
-    -if @instances
+    -if instances
       %p
         %label
           Running instance:
         %select{ :name => 'instance_id'}
-          - @instances.select{|i| i.state=="RUNNING"}.each do |instance|
+          - instances.select{|i| i.state=="RUNNING"}.each do |instance|
             %option{ :value => instance.id } #{instance.id}
     %p
       %label
         Realm:
       %select{ :name => 'realm_id'}
-        - @realms.each do |realm|
+        - realms.each do |realm|
           %option{ :value => realm.id } #{realm.id} - #{realm.name}
     %hr
     %p

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/load_balancers/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/load_balancers/show.html.haml b/server/views/load_balancers/show.html.haml
index 7123319..063d271 100644
--- a/server/views/load_balancers/show.html.haml
+++ b/server/views/load_balancers/show.html.haml
@@ -1,39 +1,39 @@
 =header "Load balancer"
-=subheader @load_balancer.id
+=subheader load_balancer.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Created at
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@load_balancer.created_at
+      %p{ :'data-role' => 'fieldcontain'}=load_balancer.created_at
     %li{ :'data-role' => 'list-divider'} Public addresses
-    - @load_balancer.public_addresses.each do |address|
+    - load_balancer.public_addresses.each do |address|
       %li
         %p{ :'data-role' => 'fieldcontain'}=address
     %li{ :'data-role' => 'list-divider'} Realms
-    - @load_balancer.realms.each do |realm|
+    - load_balancer.realms.each do |realm|
       %li
         %a{ :href => realm_url(realm.id), :'data-ajax' => 'false'}
           %h3=realm.name
     %li{ :'data-role' => 'list-divider'} Registered Instances
-    - @registered_instances.each do |instance|
+    - registered_instances.each do |instance|
       %li
         %a{ :href => instance_url(instance[:id]), :'data-ajax' => 'false'}
           %h3=instance[:name]
-          =link_to_action "Unregister", url_for("load_balancers/#{@load_balancer.id}/unregister?instance_id=#{instance[:id]}"), :post
+          =link_to_action "Unregister", url_for("load_balancers/#{load_balancer.id}/unregister?instance_id=#{instance[:id]}"), :post
     %li{ :'data-role' => 'list-divider'} Unregistered Instances
-    - @unregistered_instances.each do |instance|
+    - unregistered_instances.each do |instance|
       %li
         %a{:href => instance_url(instance[:id]), :'data-ajax' => 'false'}
           %h3=instance[:name]
-          =link_to_action "Register", url_for("load_balancers/#{@load_balancer.id}/register?instance_id=#{instance[:id]}"), :post
+          =link_to_action "Register", url_for("load_balancers/#{load_balancer.id}/register?instance_id=#{instance[:id]}"), :post
     %li{ :'data-role' => 'list-divider'} Actions
     %li
-      =link_to_action "Destroy", url_for("load_balancers/#{@load_balancer.id}"), :delete
+      =link_to_action "Destroy", url_for("load_balancers/#{load_balancer.id}"), :delete
 
   =header "Listeners", :back => 'false'
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
-    - @load_balancer.listeners.each do |listener|
+    - load_balancer.listeners.each do |listener|
       %li{ :'data-role' => 'list-divider'} Load balancer port
       %li
         %p{ :'data-role' => 'fieldcontain'}=listener.load_balancer_port

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/metrics/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/metrics/index.html.haml b/server/views/metrics/index.html.haml
index 21a9015..e4277ae 100644
--- a/server/views/metrics/index.html.haml
+++ b/server/views/metrics/index.html.haml
@@ -4,7 +4,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @metrics.each do |metric|
+    - metrics.each do |metric|
       %li
         %a{ :href => metric_url(metric.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/metric.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/metrics/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/metrics/show.html.haml b/server/views/metrics/show.html.haml
index 648ba33..403c0fd 100644
--- a/server/views/metrics/show.html.haml
+++ b/server/views/metrics/show.html.haml
@@ -1,9 +1,9 @@
 =header Metric
-=subheader @metric.id
+=subheader metric.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %div{ :'data-role' => :'collapsible-set'}
-    - @metric.properties.each do |p|
+    - metric.properties.each do |p|
       %div{ :'data-role' => :'collapsible', :'data-collapse' => 'true'}
         %h3=p.name
         %table{ :summary => "#{p.name} values"}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/realms/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/realms/index.html.haml b/server/views/realms/index.html.haml
index 5e91e56..b041003 100644
--- a/server/views/realms/index.html.haml
+++ b/server/views/realms/index.html.haml
@@ -4,7 +4,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @realms.each do |realm|
+    - elements.each do |realm|
       %li
         %a{ :href => realm_url(realm.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/realm.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/realms/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/realms/show.html.haml b/server/views/realms/show.html.haml
index f2c52f7..a2acd4d 100644
--- a/server/views/realms/show.html.haml
+++ b/server/views/realms/show.html.haml
@@ -1,17 +1,17 @@
 =header Realm
-=subheader @realm.id
+=subheader realm.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Identifier
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@realm.id
+      %p{ :'data-role' => 'fieldcontain'}=realm.id
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@realm.name
+      %p{ :'data-role' => 'fieldcontain'}=realm.name
     %li{ :'data-role' => 'list-divider'} State
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@realm.state
+      %p{ :'data-role' => 'fieldcontain'}=realm.state
     %li{ :'data-role' => 'list-divider'} Limit
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@realm.limit
+      %p{ :'data-role' => 'fieldcontain'}=realm.limit

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/storage_snapshots/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_snapshots/index.html.haml b/server/views/storage_snapshots/index.html.haml
index 4443141..3b94b67 100644
--- a/server/views/storage_snapshots/index.html.haml
+++ b/server/views/storage_snapshots/index.html.haml
@@ -3,7 +3,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @storage_snapshots.each do |snapshot|
+    - elements.each do |snapshot|
       %li
         %a{ :href => storage_snapshot_url(snapshot.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/snapshot.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/storage_snapshots/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_snapshots/show.html.haml b/server/views/storage_snapshots/show.html.haml
index 069e452..a23b677 100644
--- a/server/views/storage_snapshots/show.html.haml
+++ b/server/views/storage_snapshots/show.html.haml
@@ -1,22 +1,22 @@
 =header "Storage snapshot"
-=subheader @storage_snapshot.id
+=subheader storage_snapshot.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_snapshot.id
+      %p{ :'data-role' => 'fieldcontain'}=storage_snapshot.id
     %li{ :'data-role' => 'list-divider'} Storage volume
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_snapshot.storage_volume_id
+      %p{ :'data-role' => 'fieldcontain'}=storage_snapshot.storage_volume_id
     %li{ :'data-role' => 'list-divider'} Created
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_snapshot.created
+      %p{ :'data-role' => 'fieldcontain'}=storage_snapshot.created
     %li{ :'data-role' => 'list-divider'} State
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_snapshot.state
+      %p{ :'data-role' => 'fieldcontain'}=storage_snapshot.state
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
         - if driver.respond_to?(:destroy_storage_snapshot)
-          =link_to_action "Delete", url_for("storage_snapshots/#{@storage_snapshot.id}"), :delete
+          =link_to_action "Delete", url_for("storage_snapshots/#{storage_snapshot.id}"), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/storage_volumes/attach.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/attach.html.haml b/server/views/storage_volumes/attach.html.haml
index 073cc2a..0deb638 100644
--- a/server/views/storage_volumes/attach.html.haml
+++ b/server/views/storage_volumes/attach.html.haml
@@ -4,12 +4,12 @@
   %p
     %label
       Instance ID:
-    - if @instances.empty?
+    - if instances.empty?
       %select
         %option There are no instances
     - else
       %select{ :name => 'instance_id' }
-        - @instances.each do |i|
+        - instances.each do |i|
           %option{ :value => "#{i.id}"} #{i.name}
   %p
     %label

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/storage_volumes/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/index.html.haml b/server/views/storage_volumes/index.html.haml
index 2cc8794..2a3570c 100644
--- a/server/views/storage_volumes/index.html.haml
+++ b/server/views/storage_volumes/index.html.haml
@@ -4,7 +4,7 @@
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
     %li{ :'data-role' => 'list-divider'}=driver_symbol
-    - @storage_volumes.each do |volume|
+    - elements.each do |volume|
       %li
         %a{ :href => storage_volume_url(volume.id), :'data-ajax' => 'false'}
           %img{ :class => 'ui-link-thumb', :src => '/images/volume.png'}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a19b3d1b/server/views/storage_volumes/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/storage_volumes/show.html.haml b/server/views/storage_volumes/show.html.haml
index e7a0d69..8630daa 100644
--- a/server/views/storage_volumes/show.html.haml
+++ b/server/views/storage_volumes/show.html.haml
@@ -1,43 +1,43 @@
 =header "Storage volume"
-=subheader @storage_volume.id
+=subheader storage_volume.id
 
 %div{ :'data-role' => :content, :'data-theme' => 'c'}
   %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
     %li{ :'data-role' => 'list-divider'} Name
-    %p{ :'data-role' => 'fieldcontain'}=@storage_volume.id
+    %p{ :'data-role' => 'fieldcontain'}=storage_volume.id
     %li
-      %p{ :'data-role' => 'fieldcontain'}=(@storage_volume.name ? @storage_volume.name : @storage_volume.id)
+      %p{ :'data-role' => 'fieldcontain'}=(storage_volume.name ? storage_volume.name : storage_volume.id)
     %li{ :'data-role' => 'list-divider'} Created
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_volume.created
+      %p{ :'data-role' => 'fieldcontain'}=storage_volume.created
     %li{ :'data-role' => 'list-divider'} Capacity
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_volume.capacity
+      %p{ :'data-role' => 'fieldcontain'}=storage_volume.capacity
     %li{ :'data-role' => 'list-divider'} Realm
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_volume.realm_id
+      %p{ :'data-role' => 'fieldcontain'}=storage_volume.realm_id
     %li{ :'data-role' => 'list-divider'} State
     %li
-      %p{ :'data-role' => 'fieldcontain'}=@storage_volume.state
+      %p{ :'data-role' => 'fieldcontain'}=storage_volume.state
     %li{ :'data-role' => 'list-divider'} Attached to
     %li
-      - if @storage_volume.instance_id
-        %a{ :href => instance_url( @storage_volume.instance_id)}
-          = @storage_volume.instance_id
-      - elsif @storage_volume.state and @storage_volume.state != "IN-USE"
+      - if storage_volume.instance_id
+        %a{ :href => instance_url( storage_volume.instance_id)}
+          = storage_volume.instance_id
+      - elsif storage_volume.state and storage_volume.state != "IN-USE"
         %p{ :'data-role' => 'fieldcontain'}= 'none (detached)'
       -else
         %p{ :'data-role' => 'fieldcontain'}= 'unknown'
     %li{ :'data-role' => 'list-divider'} Device
     %li
-      %p{ :'data-role' => 'fieldcontain'}= @storage_volume.device
+      %p{ :'data-role' => 'fieldcontain'}= storage_volume.device
     %li{ :'data-role' => 'list-divider'} Actions
     %li
       %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
-        - if ["AVAILABLE", "IN-USE"].include?(@storage_volume.state)
-          =link_to_action "Snapshot...", url_for("storage_snapshots/new?volume_id=#{@storage_volume.id}"), :get
-          - unless @storage_volume.instance_id
-            =link_to_action "Delete", url_for("storage_volumes/#{@storage_volume.id}"), :delete
-            =link_to_action "Attach...", url_for("storage_volumes/#{@storage_volume.id}/attach_instance"), :get
-          - if @storage_volume.instance_id
-            =link_to_action "Detach", url_for("storage_volumes/#{@storage_volume.id}/detach"), :post
+        - if ["AVAILABLE", "IN-USE"].include?(storage_volume.state)
+          =link_to_action "Snapshot...", url_for("storage_snapshots/new?volume_id=#{storage_volume.id}"), :get
+          - unless storage_volume.instance_id
+            =link_to_action "Delete", url_for("storage_volumes/#{storage_volume.id}"), :delete
+            =link_to_action "Attach...", url_for("storage_volumes/#{storage_volume.id}/attach_instance"), :get
+          - if storage_volume.instance_id
+            =link_to_action "Detach", url_for("storage_volumes/#{storage_volume.id}/detach"), :post