rails/rails — Issue #4697: Exception after upgrade to 3.2.0 by range passed to option helpers
Author: gucki
Created: 2012-01-26 13:09:42+00:00
State: open

This worked up to 3.1.3:
=f.input :position, :as => :select, :collection => 1..100

In rails 3.2.0 it fails with:
undefined method `empty?' for 1..100:

Backtrace:
actionpack (3.2.0) lib/action_view/helpers/form_options_helper.rb:587:in `to_select_tag'
actionpack (3.2.0) lib/action_view/helpers/form_options_helper.rb:157:in `select'
actionpack (3.2.0) lib/action_view/helpers/form_options_helper.rb:641:in `select'
formtastic (2.0.2) lib/formtastic/inputs/select_input.rb:150:in `select_html'
formtastic (2.0.2) lib/formtastic/inputs/select_input.rb:145:in `block in to_html'
actionpack (3.2.0) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.0) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
actionpack (3.2.0) lib/action_view/helpers/capture_helper.rb:40:in `capture'
formtastic (2.0.2) lib/formtastic/inputs/base/wrapping.rb:11:in `input_wrapping'
formtastic (2.0.2) lib/formtastic/inputs/select_input.rb:143:in `to_html'
formtastic (2.0.2) lib/formtastic/helpers/input_helper.rb:267:in `input'
...

Work around:
=f.input :position, :as => :select, :collection => (1..100).to_a