i18n missing interpolation argument

ActionView::TemplateError (missing interpolation argument in "%Y-%m-%{count}" ({:object=>"2007-11-15"} given)) on line #110 of app/views/student/admission1.html.erb:
107:  <label for="student_date_of_birth"><%= t('date_of_birth') %> <span class="necessary-field">*</span> </label>
108:  <div class="text-input-bg">
109:  <%= calendar_date_select_tag 'student[date_of_birth]', I18n.l(Date.today-5.years,:format=>:default) , :year_range => 40.years.ago..0.years.ago, :popup=>"force" %>  
110:  </div>



Solution:

A good solution is to actually supply an interpolation variable, such as count. 
There should probably be a better interpolation variable, but that's the first one I found, and it seems to work for me.

Change line 109 from:

<%= calendar_date_select_tag 'student[date_of_birth]', I18n.l(Date.today-5.years, :format => :default) , :year_range => 40.years.ago..0.years.ago, :popup => "force" %>

to

<%= calendar_date_select_tag 'student[date_of_birth]', I18n.l(Date.today-5.years, :count => (Date.today-5.years).day, :format => :default) , :year_range => 40.years.ago..0.years.ago, :popup=>"force" %>

Comments