How to load views on an added Devise module for a custom registration controller
My rails 3.0.3 app uses devise gem (1.1.5) for authentication and before I wasn't using the :registerable module. I have since added that to enable users to sign up. I then implemented my own registration controller which extends Devise::RegistrationsController. Now when I visit the url /users/sign_up. I get "Missing template error" because rails doesn't find the registration views under app/views. I had generated the devise views using rails generate devise_views
which means that my registration views are under app/views/devise/. When I copy the views to app/views/ folder it works. This doesn't seem very DRY. Is there a way of telling rails to use the views 开发者_如何学编程in app/views/devise?
thanks, Kibet.
The easiest way is to add a line in \config\application.rb
config.paths['app/views'] << "app/views/devise"
精彩评论