From bcc67679ed824549a9b5ffb40a6c262aac4f0874 Mon Sep 17 00:00:00 2001 From: Michel Felipe de Oliveira Ferreira Date: Tue, 29 Dec 2015 15:02:53 -0300 Subject: [PATCH] Minor fix to current_date_or_nil variable --- app/helpers/forms_helper.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb index 7f04574..4b1babc 100644 --- a/app/helpers/forms_helper.rb +++ b/app/helpers/forms_helper.rb @@ -50,14 +50,14 @@ module FormsHelper def select_city( simple=false ) states = State.find(:all, :order => 'name') - + state_id = 'state-' + FormsHelper.next_id_number city_id = 'city-' + FormsHelper.next_id_number if states.length < 1 return end - + if simple states = [State.new(:name => _('Select the State'))] + states cities = [City.new(:name => _('Select the City'))] @@ -81,7 +81,7 @@ module FormsHelper states = [State.new(:name => '---')] + states cities = [City.new(:name => '---')] - html = + html = content_tag( 'div', labelled_select( _('State:'), 'state', :id, :name, nil, states, :id => state_id ), :class => 'select_state_for_origin' ) + @@ -89,7 +89,7 @@ module FormsHelper labelled_select( _('City:'), 'city', :id, :name, nil, cities, :id => city_id ), :class => 'select_city_for_origin' ) end - + html + observe_field( state_id, :update => city_id, :function => "new Ajax.Updater(#{city_id.inspect}, #{url_for(:controller => 'search', :action => 'cities').inspect}, {asynchronous:true, evalScripts:true, parameters:'state_id=' + value}); $(#{city_id.inspect}).innerHTML = ''", :with => 'state_id') end @@ -237,7 +237,7 @@ module FormsHelper weekHeader: #{datepicker_options[:week_header].to_json}, yearRange: #{datepicker_options[:year_range].to_json}, yearSuffix: #{datepicker_options[:year_suffix].to_json} - }).datepicker('setDate', current_date_or_nil) + }).datepicker('setDate', #{current_date_or_nil}) ".html_safe result @@ -296,4 +296,3 @@ protected end end end - -- libgit2 0.21.2