button-to

Rails button_to - applying css class to button

南楼画角 提交于 2019-12-18 05:27:38
问题 This is silly, but I just can't figure out how to style the input element created by Rails button_to -- and yes, I've read the docs over and over again and tried the samples. Here's my ERB code: <%= button_to "Claim", action: "claim", idea_id: idea.id, remote: true, class: 'btn btn-small' %> And this yield the following HTML: <form action="/ideas/claim?class=btn+btn-small&idea_id=4&remote=true" class="button_to" method="post"> <div> <input data-remote="true" type="submit" value="Claim">

:confirm in rails not working

无人久伴 提交于 2019-12-10 01:02:33
问题 I just started coding in ruby on rails and I've been following a guide which is using a more outdated version of rails than I am using. I am using 3.2.12 This is my code: <%= button_to 'Destroy', product, :method => "delete", :confirm => 'Are you sure?' %> From what I understand, these are symbols that are passed to rails, which is then converted to either an html or javascript action that then pops up the message box and deletes the object if applicable. The above code destroys the object,

Rails button_to - applying css class to button

Deadly 提交于 2019-11-29 09:05:26
This is silly, but I just can't figure out how to style the input element created by Rails button_to -- and yes, I've read the docs over and over again and tried the samples. Here's my ERB code: <%= button_to "Claim", action: "claim", idea_id: idea.id, remote: true, class: 'btn btn-small' %> And this yield the following HTML: <form action="/ideas/claim?class=btn+btn-small&idea_id=4&remote=true" class="button_to" method="post"> <div> <input data-remote="true" type="submit" value="Claim"> <input name="authenticity_token" type="hidden" value="pU3umgqrDx3WbalfNK10c9H5B5N4OzPpohs4bWW8mow="> </div>