carmen-ruby / carmen-rails

NOT ACTIVELY MAINTAINED Rails adapter for Carmen (provides country_select and subregion_select)
MIT License
215 stars 159 forks source link

Ensure form object is passed down to InstanceTag #28

Closed ecbypi closed 10 years ago

ecbypi commented 11 years ago

The country_select and subregion_select methods on ActionView::Helpers::FormBuilder do not update the options hash with the :object key, resulting in the value of the object passed into the form builder not being selected in the HTML output.

Updated FormBuilder methods to add its object to the options hash and cleaned up the logic for supporting the legacy API for priority countries.

Add tests for these regressions and update the test suite to pass a symbol instead of an OpenStruct instance when using the FormOptionsHelper methods as this is the intended API for these methods (based on what I can glean from the Rails APIs and code).

pat commented 11 years ago

Just gave this a spin, works for me too.