Search code examples
ruby-on-railstwitter-bootstrapsimple-form

Rails simple form button text


I have tried these formats and others. What format is needed to change the text on the simple form button? Thanks!

<%= f.button :submit, :label => 'Assign', class: "btn btn-default btn-primary" %>

<%= f.button :submit, 'Assign', class: "btn btn-default btn-primary" %>

<%= f.button :submit, input_html: { :label => 'Assign' etc } %>

Solution

  • I assume you want to display label for submit button. Following would give you what you want

    <%= f.submit 'Assign', class: "btn btn-default btn-primary" %>