On 29/11/10 15:42 +0000, mtaylor(a)redhat.com wrote:
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/helpers/providers_helper.rb | 2 +-
src/app/views/providers/_providers.haml | 2 +-
src/spec/helpers/providers_helper_spec.rb | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/app/helpers/providers_helper.rb b/src/app/helpers/providers_helper.rb
index 4da2a0b..5cff42c 100644
--- a/src/app/helpers/providers_helper.rb
+++ b/src/app/helpers/providers_helper.rb
@@ -1,7 +1,7 @@
module ProvidersHelper
def edit_button(provider, action)
- if provider and ['show', 'accounts'].include? action
+ if provider and ['show'].include? action
Just minor comment here. You can use action.eql?('show') or
action=='show'
since there is no Array anymore.
link_to 'Edit', edit_provider_path(provider), :class
=> 'button'
else
content_tag('a', 'Edit', :href => '#', :class =>
'button disabled')
diff --git a/src/app/views/providers/_providers.haml
b/src/app/views/providers/_providers.haml
index 8d184a5..279b257 100644
--- a/src/app/views/providers/_providers.haml
+++ b/src/app/views/providers/_providers.haml
@@ -11,4 +11,4 @@
- form_tag({:controller => 'providers', :action => 'new'},
{:method => :get , :class => 'buttononly'}) do
%input{ :type => 'submit', :value => t(:add), :disabled =>
('disabled' unless controller.action_name == 'index') }
- form_tag({:controller => 'providers', :action => 'destroy', :id
=> @provider}, {:method => :delete , :class => 'buttononly'}) do
- = submit_tag 'delete', :disabled => ('disabled' unless @provider
and ['show', 'accounts'].include? controller.action_name)
+ = submit_tag 'delete', :disabled => ('disabled' unless @provider
and ['show'].include? controller.action_name)
Same as above ^^
\ No newline at end of file
diff --git a/src/spec/helpers/providers_helper_spec.rb
b/src/spec/helpers/providers_helper_spec.rb
index ef7bc30..10b1476 100644
--- a/src/spec/helpers/providers_helper_spec.rb
+++ b/src/spec/helpers/providers_helper_spec.rb
@@ -9,7 +9,6 @@ describe ProvidersHelper do
provider = Factory(:mock_provider)
edit_button(provider, 'show').should =~ /providers\/[0-9]*\/edit/
- edit_button(provider, 'accounts').should =~ /providers\/[0-9]*\/edit/
end
it "formats blank link with no action and with disabled class if not in show or
accounts action" do
--
1.7.2.3
_______________________________________________
deltacloud-devel mailing list
deltacloud-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/deltacloud-devel
--
--------------------------------------------------------
Michal Fojtik, mfojtik(a)redhat.com
Deltacloud API:
http://deltacloud.org
--------------------------------------------------------