This project is archived and is in readonly mode.
Namespace and Custom routes
-
Andrew White
- State changed from new to needs-more-info
- Importance changed from to Low
Works in a brand new 3.0.6 app for me - are you sure your controller names are correct?
-
Rafael Felix
Andrew, I think the name is ok
take a look (it's inside app/controllers/admin
file name dashboard_controller.rb
class Admin::DashboardController < Admin::AdminController load_and_authorize_resource def index end endand the Admin::AdminController (admin_controller.rb)
class Admin::AdminController < ApplicationController layout 'admin' before_filter :authenticate_user! endbest regards
Rafael -
Andrew White
Do you have an Admin::Dashboard model?
-
Rafael Felix
No, I don't have any
I don't know if it helps, but the authentication is provided by devise, and the load_and_authorize_resource is from CanCan
-
Andrew White
Can you post a backtrace?
-
Rafael Felix
at the first time, before_filter send me to the login
Started GET "/admin" for 127.0.0.1 at 2011-04-08 00:03:17 -0300
SQL (60.1ms) SHOW client_min_messages SQL (0.9ms) SET client_min_messages TO 'panic' SQL (0.8ms) SET standard_conforming_strings = on SQL (1.6ms) SET client_min_messages TO 'notice' SQL (62.6ms) SET time zone 'UTC' SQL (1.0ms) SHOW TIME ZONE Processing by Admin::DashboardController#index as HTML Completed in 3msStarted GET "/users/sign_in" for 127.0.0.1 at 2011-04-08 00:03:19 -0300
Processing by Devise::SessionsController#new as HTML SQL (327.9ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnumRendered devise/shared/_links.erb (6.6ms)
Rendered devise/sessions/new.html.erb within layouts/application (347.7ms)
Completed 200 OK in 1058ms (Views: 493.8ms | ActiveRecord: 454.9ms)after the devise login
Started GET "/admin" for 127.0.0.1 at 2011-04-08 00:07:17 -0300
Processing by Admin::DashboardController#index as HTML SQL (48.3ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum User Load (8.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 SQL (3.3ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum Completed in 546msNameError (uninitialized constant Dashboard):
Rendered /home/suerafa/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.6/lib/action_dispatch/middleware/templates/rescues/trace.erb (2.1ms)
Rendered /home/suerafa/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.6/lib/action_dispatch/middleware/templates/rescues/request_and_response.erb (155.2ms)
Rendered /home/suerafa/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (167.4ms) -
Andrew White
- State changed from needs-more-info to invalid
Your problem is CanCan - it's trying to authorise the Dashboard resource which doesn't exist