method
submit_tag
![Wide documentation Importance_3](https://d2vfyqvduarcvs.cloudfront.net/images/importance_3.png?1349367920)
submit_tag(value = "Save changes", options = {})
public
Creates a submit button with the text value as the caption. If options contains a pair with the key of "disable_with", then the value will be used to rename a disabled version of the submit button.
Register or
log in
to add new notes.
carlosbrando -
June 7, 2012
boblin -
June 5, 2012
danielpclark -
January 14, 2015
![Default_avatar_30](https://www.gravatar.com/avatar/aa3622edf87e418d834aa66d6a8c8e4c?default=http://apidock.com/images/default_avatar_30.png&size=30)
2 thanks
:disable_with is deprecated
Or you can use this way:
<%= submit_tag "Login", data: { disable_with: "Please wait.." } %>
![Default_avatar_30](https://www.gravatar.com/avatar/e0fd5e98d98e9415e5fa94ac1155ce37?default=http://apidock.com/images/default_avatar_30.png&size=30)
1 thank
:disable_with is deprecated
Since version 3.2.5 you should not use :disable_with.
Use this:
<%= submit_tag "Login", 'data-disable-with' => "Please wait.." %>
![Default_avatar_30](https://www.gravatar.com/avatar/1d4ca4f4362bf8b0b528e35361743e82?default=http://apidock.com/images/default_avatar_30.png&size=30)
0 thanks
Have submit_tag send value as a nested resource
To have the submit_tag send it’s value within a nested resource for strong params use the name paramter.
submit_tag("Send", name: 'article[submit]')