I am using simple_form and the following code to create the button.
<%= form.action :submit, :value => "submit", :button_html => { :class => "lagoon" } %>
However the button is (still) labeled 'Create User' instead of 'submit'. I thought setting the value => would do it but it didn't
Probably better and correct way is to use :label key and keep :button_html for styling
<%= form.action :submit, :label => "Submit", :button_html => { :class => "lagoon" } %>
I think best idea is to use I18n keys. Check Formtastic docs :
Formtastic decides which label to use in the following order:
原来我需要这样做:
<%= form.action :submit, :button_html => { :value => 'Submit', :class => "lagoon" } %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.