attr_accessible :time_limit # declared to be :integer in migration
# omitted
end
When I generate a simple_form for an instance of Test,
<%= f.input :time_limit %>
renders the text-field with counter control (small-up/down arrows to increment/decrement integer value) as it gives that field a class: integer and numeric.
This is expected.
However, when I have an instance of this model Test inside another model say Exam and I use simple_fields_for
like:
<%= simple_form_for @exam do |f| %>
....
<%= f.simple_fields_for :test do |test_form| %>
<%= test_form.input :time_limit %>
<% end %>
<%end %>
I find that the same field is now rendered with string class losing the counter control! Even if I use :input_html => "numeric integer", since in the rendered HTML (:class = "string numeric integer"), "string" prevails, the counter control is lost.
What am I doing wrong?
Regards,
Kedar