So my button_to erb tag gives me something similar what is below and I was wondering if it was possible to add an id to the div by passing something along in the options hash rather than using js or adding html manually:
<div>
<input id="button" type="submit" value="title">
<input name="auth_token">
</div>
My button erb code is just
<%= button_to title, {}, :id => "button"%>
As of 3.2, button_to accepts a hash of form attributes via the html_options key "form"
<%= button_to title, {}, :form => { :id => "button" } %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With