vhochstein / active_scaffold

Rails 4 Version of activescaffold supporting jquery
MIT License
156 stars 34 forks source link

Security method not working with custom links. #164

Closed cicloon closed 13 years ago

cicloon commented 13 years ago

Im trying to set a security method to prevent an action being viewed with security method, I define it this way:

config.action_links.add(I18n.t('devices.deactivate'), :inline => false, :page => false, :type => :member, :action => 'deactivate', :security_method => :check_active)

But when I try to see it I get the following error:

Showing /opt/ruby/lib/ruby/gems/1.8/gems/active_scaffold_vho-3.0.20/frontends/default/views/_action_group.html.erb where line #4 raised:

wrong number of arguments (1 for 0)

1: <% record ||= nil 2: start_level_0_tag ||= '' 3: end_level_0_tag ||= ''%> 4: <% action_links.traverse(controller, traverse_options) do |parent, link, options| -%> 5: <% if (options[:node] == :finished_traversing) -%> 6: <%= "#{(options[:level] == 0 ? "

#{end_level_0_tag}": '')}".html_safe %> 7: <% elsif (options[:node] == :start_traversing) -%>

Am I doing something wrong?

Thank you very much.

vhochstein commented 13 years ago

Could you please post your :check_active method

cicloon commented 13 years ago

At the moment its just a method returning false.

vhochstein commented 13 years ago

Yes, an that error is telling you that you did not define correct method signature. I hope your definition is: def check_active(record = nil)

vhochstein commented 13 years ago

Will close this issue... in case of any further questions...