Ronald Fischer
2014-Jul-07 13:15 UTC
Changing display text of submit button without changing value passed to controller
Please have a look at this form:
<%= form_for @data, url: data_path do |f| %>
...
<%= f.submit("accept", name:"judgement") %>
<%= f.submit("reject", name:"judgement") %>
<% end %>
These buttons display "accept" and "reject". Clicking on the
first
button would pass
"judgement" => "accept"
to the application. This is exactly what I want, but I want to be able
to change the text which is visible on the button (for example, when
displaying the page in a different language).
Can this be done?
Ronald
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/5e24e429be3356cc4cda3e666fc7fac2%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.