开发者

How to load views on an added Devise module for a custom registration controller

开发者 https://www.devze.com 2023-02-13 12:28 出处:网络
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 registr

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"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号