I\'m trying to create a form with some custom data attributes on the inputs:
This seemed
Oops. It's just
<%= f.text_field :question, :id=>"poll_question", :class=>"BigInput", :style=>"width:98%;", 'data-submit_clear'=>'1' %>
Rails >3.1 has a handy shortcut for data-attributes like this which most HTML-generating helpers support:
<%= f.text_field :question, :data => { :submit_clear => '1' } %>
It can make things more readable when you have a couple of data attributes, e.g.:
<%= f.text_field :question, :data => { :submit_clear => '1', :more_info => 'Ok', :also => 'this' } %>