Question

My route file is as follows:

  devise_for :admins
  mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'

I have an admin model as follows:

class Admin < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable,
         :recoverable, :rememberable, :trackable, :validatable

end

After an admin signs in the route is wrong

http://localhost:3000/admin/s/sign_in

And I get the following error message:

Model 'S' could not be found

How can I fix this route?

Thanks

Was it helpful?

Solution

I needed to change my route to match the following:

 devise_for :admins
  mount RailsAdmin::Engine => '/admins', :as => 'rails_admin'

and tell Devise that I am using admins and not users as the model

OTHER TIPS

Why your routes have /s after admin/, I think it must look like this:

http://localhost:3000/admin/sign_in

To make sure run rake routes

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top