Custom Form Submit Button Text – Ruby on Rails

Just a quick post on how to set the text of a form submit button. By default, the tag will appear as follows:

1
2
3
<div class="actions" style="text-align:center">
     <%= f.submit %>
</div>

In order to change the text all you have to do is the following, where ‘Set Location’ is your new text:

1
2
3
<div style="float:left">
    <%= f.submit 'Set Location' %>
</div>

Good Luck!

Leave a Reply