I have this custom form builder, and it calls:
basic_input_helper(:text_field, :date, :date_value, options.merge!({:html_options => {:class => "datepicker"}})) if options[:response_class] == "date"
The fourth parameter there are the options (the html
options, if I read the code correctly), and I would expect that line to add class="datepicker"
to my input field, but instead I get:
<input id="r_3_date_value" name="r[3][date_value]" size="30" type="text" value="2012-07-02" />
No class
attribute at all. What am I missing?
You have to use the key :input_html
instead of :html_options
basic_input_helper(:text_field, :date, :date_value, options.merge!({:input_html => {:class => "datepicker"}})) if options[:response_class] == "date"
The code gets evaluated like this (source on github), you can see the evaluation for input html on line 647