我尝试从另一个控制器更新设计用户属性。
这是表格
= form_for @client, url: { action: 'update', controller: '/registrations'} , :html => { method: :patch } do |f|
= f.text_field :name
= f.text_field :email
= f.text_field :phone
= f.submit
但shell显示错误
No route matches {:action=>"update", :controller=>"registrations", :id=>"5"}
如何解决?
抱歉我的英文不好
答案 0 :(得分:2)
试试这个
= form_for @client, url: registration_path(:user), method: :put do |f|
或强>
= form_for @client, url: { action: 'update', controller: 'devise/registrations'}, method: :put do |f|
希望这有帮助!