activescaffold/active_scaffold — Issue #95: problem with <action>_authorized? methods
Author: khelal
Created: 2011-11-25 11:46:57+00:00
State: open

Given the following controller:

````
class Admin::AdminUsersController < Admin::AdminController

active_scaffold :admin_user do |config|
config.label = 'Administration Users'
config.list.columns = [:login, :email, :manager, :accountant, :last_sign_in_ip, :current_sign_in_ip, :last_sign_in_at]
config.create.columns = [:login, :email, :password, :password_confirmation, :manager, :accountant]
end

private

def index_authorized?
false
end

def create_authorized?
false
end

def update_authorized?
false
end

def delete_authorized?
false
end

end

````

I get the following error when browsing the page:

````
Started GET "/en/guru/admin_users" for 127.0.0.1 at Fri Nov 25 15:45:29 +0400 2011
Creating scope :public. Overwriting existing method Tender.public.
Processing by Admin::AdminUsersController#index as HTML
Parameters: {"locale"=>"en"}
AdminUser Load (0.3ms) SELECT "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = 1 LIMIT 1
(0.5ms) SELECT COUNT(*) FROM "admin_users"
AdminUser Load (0.5ms) SELECT "admin_users".* FROM "admin_users" ORDER BY "admin_users"."id" ASC LIMIT 15 OFFSET 0
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_action_group.html.erb (2.8ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_header.html.erb (17.2ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_column_headings.html.erb (7.4ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_messages.html.erb (0.8ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_messages.html.erb (14.8ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_record_columns.html.erb (4.8ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_action_group.html.erb (4.2ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_actions.html.erb (16.5ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_record.html.erb (43.1ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list.html.erb (366.2ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/_list_with_header.html.erb (405.3ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/bundler/gems/active_scaffold-fca072d419bf/frontends/default/views/list.html.erb within layouts/admin (416.3ms)
Completed 500 Internal Server Error in 465ms

ActionView::Template::Error (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) -%>
lib/rack/chrome_frame.rb:35:in `call'

Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
Rendered /Users/khelal/.rvm/gems/ree-1.8.7-2011.03@monaqasat3/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (5.5ms)
````

Any ideas?