I came across this thread looking for a way to change the value for f.button :submit
, not f.submit
. The reason I'm using f.button :submit
is because I'm using bootstrap to style the button, and the class: "btn btn-primary"
argument needs to be passed to the .button method. Anyways, I couldn't find any documentation on it, so I messed around a bit and found the solution.
At first I tried <%= f.button :submit, "Create", class: "btn btn-primary" %> but it gave me an error saying I was passing 3 arguments when there should only be 2, which is what I expected.
So here's what solved the problem:
<%= f.button :submit => "", class: "btn btn-primary" %>
This made the button text what I wanted "Create Article". Before, when I just had f.button :submit
, the button text was "submit", which I'm guessing was pulled from the symbol and converted into a string. Can anyone explain why passing an empty hash value did the trick?