activeadmin: undefined method 'admin_user_url'
When trying to login to Active Admin, an exception is thrown…
NoMethodError in ActiveAdmin::Devise::SessionsController#create
undefined method `admin_user_url' for #<ActiveAdmin::Devise::SessionsController:0x007fa820e565d0>
I’m running Rails 3.2.1, Active Admin 0.4.3 and Devise 2.0.0
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 22 (8 by maintainers)
Never figured it out. Switched to https://github.com/sferik/rails_admin
Had the same problem, it solved itself when I restarted the server
Yep the solution was actually just to add a "super " in my after_sign_in_path_for method like that :
If this helps anyone, I was having the same issue and determined that it was because I had a User model in addition to the AdminUser model, where I was overriding the after sign in redirection as listed on Devise’s wiki. Adding @sandeep45’s code snippet fixed the issue for me:
So i finally resolved this problem. It seems to be looking for admin_user_url but when i do rake routes, i don’t have any such route. All routes are admin_path like, there is no _user in the end. I verified my model name is AdminUser. So i am not sure why the routes are like admin_path and not admin_user_path. Either way to fix it in my after_sign_in_path_for i added:
this made sure it went to a path which exists? Can someone explain why are the routes named differently from what the model name is? thanks