I'm trying to have the following routes:
/admin/sign_in
/admin/sign_out
In order to do this i have the following in routes.rb:
devise_for :admin
namespace :admin do
root :to => 'admin/welcome#index'
end
My model is User. When i have the above code and i run rake routes, i
get an error:
undefined method `devise_modules' for #<Module:0x00000103488518>
Perhaps this is caused by my model named User instead of Admin?
Is there a way to get this to work?
Thanks,
Jeroen
p.s. The devise_views generator generates the views in the root rails
app dir, *not* in app/views (copied them manually there).
source 'http://gemcutter.org'
## Bundle edge rails:
gem "rails", "3.0.0.beta1", :git => "git://github.com/rails/rails.git"
## Bundle the gems you use:
gem "devise", :git => "git://github.com/plataformatec/devise.git"
gem "mysql"
gem "warden", "0.9.4"
My application.rb is still the default generated one.
Jeroen
On Feb 23, 8:49 pm, José Valim <jose.va...@gmail.com> wrote:
> This is for Rails 3? Which Devise version?
>
> Please pastie your Gemfile and config/application.rb.
>
On Feb 23, 9:08 pm, José Valim <jose.va...@gmail.com> wrote:
> Please post the error backtrace as well!
>
Jeroen
On Feb 23, 9:16 pm, José Valim <jose.va...@gmail.com> wrote:
> Wait. When you do:
>
> devise_for :admins
>
> It uses Admin. If you are using another model, you have to specify it:
>
> devise_for :admins, :class_name => "User"
>
> This information is in the documentation as well.
>