ruby - Use Devise in rails application with engines -
i creating rails application , separated application 2 engines. application uses devise gem user registration , authorization. devise gem connected in root app , admin side lying inside 1 of engines. admin side layout still inside root application. if use code <%= link_to edit_user_registration_path %>
in admin layout showing me following exception:
undefined local variable or method `edit_user_registration_path'
at /app/views/layouts/admin.html.erb
can please me solve problem. can reason outcome?
i think have messed routes.rb
..let me give u hint...
for /admin/posts
, admin/posts#index
, <%= link_to admin_posts_path %>
work,your routes must have
namespace :admin resources :posts, :comments end
but like(only url , helper/controller without admin) work
`/admin/posts` , `posts#index` , `<%= link_to posts_path %>`
then ...your routes must have
resources :posts, path: /admin/posts
so must have in routes(using devise)
devise_for :users,:controllers => {:registrations => "users/devise/registrations"}
which give you:-
edit_user_registration
get /users/edit(.:format)
users/devise/registrations#edit
i think should you.
Comments
Post a Comment