Hello,
I have a form that should be a POST method, but Rails insist to put a hidden field "_method" that has the value "put" does anyone knows why?
Thanks,
David Sousa
Controller: ------------------------------- def new @user = @current_user end
Hello,
I have a form that should be a POST method, but Rails insist to put a hidden field "_method" that has the value "put" does anyone knows why?
Thanks,
David Sousa
Controller: ------------------------------- def new @user = @current_user end
I have a form that should be a POST method, but Rails insist to put a hidden field “_method” that has the value “put” does anyone knows why?
Since @user already exists in the database (you assign an existing record @current_user to it) and is not a new_record?, Rails assumes you want to update the record aka a PUT request. Probably just adding :method => :post as a parameter will do the trick.
Thanks Peter, just adding :method => :post worked.
Let me ask one more thing, just after a submit the form, the firefox open a dialog box asking me each of users that is in a list that I want to change the password. Actually does not matter each you pick, the user that you are logon on the site gets the pass changed.
Tks again.
David Sousa