Forum: Ruby on Rails Problem using a date helper

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ba5816b2a9c23d87324e3b98beabba8c?d=identicon&s=25 alisonrowland (Guest)
on 2005-12-01 18:39
(Received via mailing list)
Hi,

I'm having trouble getting a date helper working. I was pointed to
this by Sean Allen, and it resides at
http://theredheadedstepchild.net/articles/2005/08/...

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):

16: 	<tr>
17: 		<td>
18: 			<p><label for="train_stonybrook_at">Stony Brook at</label><br/>
19: 				<%= time_select "train", "stonybrook_at"%>
20: 			</p>
21: 		</td>
22: 		<td>

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
bundle.

Thanks,
Alison
This topic is locked and can not be replied to.