activescaffold/active_scaffold — Issue #87: date_picker_bridge - TypeError: can't convert Symbol into Integer
Author: slavix
Created: 2011-11-09 02:19:22+00:00
State: open

Getting this error with Rails 3.1 active_scaffold 3.1.7

Error compiling asset store/all.js:
TypeError: can't convert Symbol into Integer
(in /home/slava/.rvm/gems/ruby-1.9.2-p290/gems/active_scaffold-3.1.7/app/assets/javascripts/jquery/date_picker_bridge.js.erb)

tracked it down to this code:
helper.rb
..
def self.date_options(locale)
begin
date_options = I18n.translate! 'date', :locale => locale
date_picker_options = { :closeText => as_(:close),
:prevText => as_(:previous),
:nextText => as_(:next),
:currentText => as_(:today),
:monthNames => date_options[:month_names][1, (date_options[:month_names].length - 1)],
:monthNamesShort => date_options[:abbr_month_names][1, (date_options[:abbr_month_names].length - 1)],
:dayNames => date_options[:day_names],
:dayNamesShort => date_options[:abbr_day_names],
:dayNamesMin => date_options[:abbr_day_names],
:changeYear => true,
:changeMonth => true,
}
...

date_options is evaluated as "Date" and calling on date_options[:month_names] throws error.