diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5433baf..c019500 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -468,23 +468,23 @@ module ApplicationHelper content_tag('div', result) end - def select_city(name, top_level='Nacional') - city_field_name = "#{object}[#{method}]" - state_field_name = "#{object}_#{method}_state" - region_field_name = "#{object}_#{method}_region" - - selected_state = nil - selected_region = nil - - regions = Region.find_by_name(top_level).children - - select_tag(region_field_name, options_for_select(regions.map {|r| [r.name, r.id] } + ['---','']) + - select_tag(state_field_name, options_for_select(['---', ''])) + - select_tag(city_fied_name, options_for_select(['---',''])) + - - observe_field(country_field_name, :update => state_field_name, :url => { :controller => 'geography', :action => 'states' }, :with => 'country' ) + - observe_field(country_field_name, :update => city_field_name, :url => { :controller => 'geography', :action => 'cities_by_country' }, :with => 'country') + - observe_field(state_field_name, :update => city_field_name, :url => { :controller => 'geography', :action => 'cities' }, :with => 'state_id') - end +# def select_city(name, top_level='Nacional') +# city_field_name = "#{object}[#{method}]" +# state_field_name = "#{object}_#{method}_state" +# region_field_name = "#{object}_#{method}_region" +# +# selected_state = nil +# selected_region = nil +# +# regions = Region.find_by_name(top_level).children +# +# select_tag(region_field_name, options_for_select(regions.map {|r| [r.name, r.id] } + ['---','']) + +# select_tag(state_field_name, options_for_select(['---', ''])) + +# select_tag(city_fied_name, options_for_select(['---',''])) + +# +# observe_field(country_field_name, :update => state_field_name, :url => { :controller => 'geography', :action => 'states' }, :with => 'country' ) + +# observe_field(country_field_name, :update => city_field_name, :url => { :controller => 'geography', :action => 'cities_by_country' }, :with => 'country') + +# observe_field(state_field_name, :update => city_field_name, :url => { :controller => 'geography', :action => 'cities' }, :with => 'state_id') +# end end -- libgit2 0.21.2