如何覆盖devise registrations_controller.rb以更改模板?
我在registrations_controller.rb中有这样的代码:
class RegistrationsController < Devise::RegistrationsController
layout :defined_layout
def edit
super
render :template => "registrations/edit2"
end
end
我的根:
devise_for :users, :controllers => { :sessions => "user_sessions", :registrations => "registrations", :omniauth_callbacks => "users/omniauth_callbacks" },
:path_names => { :sign_in => 'login', :sign_out => 'logout', :registration => 'register' }
我不会改变模板以便在设计中编辑我的帐户? 告诉我该怎么做? 感谢
答案 0 :(得分:0)
实际上你不需要覆盖控制器。您可以通过创建以下文件来覆盖编辑视图:
视图/设计/注册/ edit.html.erb