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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -