In my grid this,
link_to('Edit', edit_manage_user_path(user.id))
works fine but this,
link_to('Delete', delete_manage_user_path(user.id))
gives the error "undefined method `delete_manage_user_path' for #<#:0xc05439c>" given that there is a delete action in my controller..
Any idea why this error is coming?
If you use resources
routes, path to destroy
action is the same as to show
, but you should use HTTP DELETE
method:
link_to 'Delete', [:manage, user], method: :delete
link_to 'Delete', manage_user_path(user), method: :delete
This will call your delete action. there is no such path delete_manage_user_path(user)
if you are using restful routing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With