0

I trying to update devise user attributes from another controller.

here is form

= 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

but shell show me an error

No route matches {:action=>"update", :controller=>"registrations", :id=>"5"}

how fix it?

sorry for my bad English

wweare
  • 241
  • 1
  • 2
  • 9

1 Answers1

2

Try this instead

= form_for @client, url: registration_path(:user), method: :put do |f|

or

= form_for @client, url: { action: 'update', controller: 'devise/registrations'}, method: :put do |f|

Hope this helps!

Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78