Make button_to helper support "form" option #3156

Merged
merged 1 commit into from Sep 28, 2011

Projects

None yet

2 participants

@ihower

see #3154, we need a way can add attributes to form tag:

<%= button_to "foo", "/foo", :remote => true, :form => { "data-type" => "json" } %>

will generate

<form method="post" action="/foo" class="button_to" data-remote="true" data-type="json"><div><input  type="submit" value="foo" />...</div></form>

p.s. there is a "form_class" option may become redundant since we can pass :form => { :class => "custom_class" }

@spastorino spastorino merged commit a5e7318 into rails:master Sep 28, 2011
@ihower ihower deleted the ihower:enhance_button_to_helper_v2 branch Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment