I am using devise with rails 4 and want to apply a custom layout for my login and registration pages. I have found this link and used this code in my application_controller.rb code-
layout :layout_by_resource
def layout_by_resource
if devise_controller? && resource_name == :user && action_name == 'new'
"devise"
else
"application"
end
end
this code however gives me a template missing error
也许您没有创建app/views/layouts/devise.html.erb
模板文件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.