-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with RailsAdmin. "The action 'new' could not be found for DeviseTokenAuth::SessionsController" #107
Comments
|
Can't I use Devise for web while using this gem? |
You can use devise alongside this gem, but you will need to mount the routes to a different path. For example: Rails.application.routes.draw do
# token auth routes available at /api/v1/auth
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
# standard devise routes available at /users
devise_for :users
end |
Your routes.rb config fixes the route issue. But there is a new problem now. In Rails Admin panel, when I try to Log Out, it goes to
Reason:
|
Can this be solved by moving the Rails.application.routes.draw do
# standard devise routes available at /users
devise_for :users
# token auth routes available at /api/v1/auth
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
end |
And this works. Thank you! 👍 |
🤘 |
I want to use RailsAdmin gem for my API application.
when I visit "localhost:3000/admin"
I get:
The action 'new' could not be found for DeviseTokenAuth::SessionsController
my
routes.rb
Ruby 2.2
Rails 4.2
The text was updated successfully, but these errors were encountered: