I’m having trouble getting a date helper working. I was pointed to
this by Sean A., and it resides at
It’s meant to fix the bug in Rails which doesn’t allow datetime_select
to properly discard the year.
So, I’m trying to use the helper’s time_select function.
date_helper.rb is in my helpers directory. In my controller, it’s
included with “helper :date”
In my view, I have the code
<%= time_select ‘train’, ‘stonybrook_at’ %>
If I use the helper file as-is, when I try to load my view, I get the
error “Uninitialized constant DateHelper”. If I comment out the lines
“module ActionView” and “module Helpers”, I get past that error, but
then I’m stuck with another error:
ArgumentError in Admin/trains#new
Showing app/views/admin/trains/_form.rhtml where line #19 raised:
wrong number of arguments (3 for 0)
Extracted source (around line #19):
Stony Brook at
19: <%= time_select “train”, “stonybrook_at”%>
The line it references in date_helper.rb looks like this:
InstanceTag.new(object, method, self).to_datetime_select_tag(options)
What am I doing wrong?
BTW, I’m on OS X 1.4.3, using Locomotive with the Rails 0.14.3 Max