Commit bcc67679ed824549a9b5ffb40a6c262aac4f0874

Authored by Michel Felipe
1 parent 9f3043a6

Minor fix to current_date_or_nil variable

Showing 1 changed file with 5 additions and 6 deletions   Show diff stats
app/helpers/forms_helper.rb
... ... @@ -50,14 +50,14 @@ module FormsHelper
50 50  
51 51 def select_city( simple=false )
52 52 states = State.find(:all, :order => 'name')
53   -
  53 +
54 54 state_id = 'state-' + FormsHelper.next_id_number
55 55 city_id = 'city-' + FormsHelper.next_id_number
56 56  
57 57 if states.length < 1
58 58 return
59 59 end
60   -
  60 +
61 61 if simple
62 62 states = [State.new(:name => _('Select the State'))] + states
63 63 cities = [City.new(:name => _('Select the City'))]
... ... @@ -81,7 +81,7 @@ module FormsHelper
81 81 states = [State.new(:name => '---')] + states
82 82 cities = [City.new(:name => '---')]
83 83  
84   - html =
  84 + html =
85 85 content_tag( 'div',
86 86 labelled_select( _('State:'), 'state', :id, :name, nil, states, :id => state_id ),
87 87 :class => 'select_state_for_origin' ) +
... ... @@ -89,7 +89,7 @@ module FormsHelper
89 89 labelled_select( _('City:'), 'city', :id, :name, nil, cities, :id => city_id ),
90 90 :class => 'select_city_for_origin' )
91 91 end
92   -
  92 +
93 93 html +
94 94 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 = '<option>#{_('Loading...')}</option>'", :with => 'state_id')
95 95 end
... ... @@ -237,7 +237,7 @@ module FormsHelper
237 237 weekHeader: #{datepicker_options[:week_header].to_json},
238 238 yearRange: #{datepicker_options[:year_range].to_json},
239 239 yearSuffix: #{datepicker_options[:year_suffix].to_json}
240   - }).datepicker('setDate', current_date_or_nil)
  240 + }).datepicker('setDate', #{current_date_or_nil})
241 241 </script>
242 242 ".html_safe
243 243 result
... ... @@ -296,4 +296,3 @@ protected
296 296 end
297 297 end
298 298 end
299   -
... ...