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. <div class="actions" style="text-align:center">
  2.      <%= f.submit %>
  3. </div>

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

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

Good Luck!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.