Forum: Ruby on Rails Getting undefined method time_select

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.
9de683079d6fc8c9a681124830178c56?d=identicon&s=25 stephenacross@gmail.com (Guest)
on 2007-03-22 15:27
(Received via mailing list)
Is this a rails version issue?   Any suggestions for alternative?

ActionView::TemplateError (undefined method `time_select' for
#<#<Class:0xb790c54c>:0xb790c524>) on line #14 of app/views/admin/
_taskform.rhtml:
11:     </p>
12:     <p>
13:       <label for="start_at">Start:</label>
14:       <%=  time_select('task', 'start_at') %>
15:     </p>
16:     <p>
17:       <label for="end_at">End:</label>

Thanks.
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2007-03-22 16:28
(Received via mailing list)
Hi Stephen,

stephenacross@gmail.com wrote:

> ActionView::TemplateError (undefined method `time_select' for
> 14:     <%=  time_select('task', 'start_at') %>

How is the start_at field in your tasks table defined?

Bill
9de683079d6fc8c9a681124830178c56?d=identicon&s=25 stephenacross@gmail.com (Guest)
on 2007-03-22 16:45
(Received via mailing list)
Hi Bill -

    create_table :tasks do |t|
      t.column "room_id", :integer
      t.column "work_on", :date
      t.column "start_at", :time
      t.column "end_at", :time
      t.column "desc", :string
      t.column "needed", :integer

This works on my local machine, when I move it out to RailsPlayground
I am getting this error.

-Stehen.
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2007-03-22 17:36
(Received via mailing list)
Hi Stephen,

stephenacross@gmail.com wrote:

>      t.column "start_at", :time

> This works on my local machine, when I move it
> out to RailsPlayground I am getting this error.

I'd recommend you put together a very, very minimal sandbox app and try
that
on RailsPlayground.  By minimal I mean, for example, take out everything
in
the table except start_at.  Have one controller with two methods, one to
display the view for entry of the date, and one to save the result to
the
database.  Have two views, one that allows the entry of that field, if
that's what your app allows and the other that displays the value that
got
saved or an appropriate error message.  If the problem is still
demonstrable, then document the config of your local machine including
gem
list, plugins, versions of everything, and submit a ticket to your
support
team.  In my experience, you definitely need to have something the
support
team can work with to get them engaged.

Best of luck,
Bill
9de683079d6fc8c9a681124830178c56?d=identicon&s=25 stephenacross@gmail.com (Guest)
on 2007-03-22 17:45
(Received via mailing list)
Thank you Bill.
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2007-03-22 18:55
(Received via mailing list)
On Mar 22, 2007, at 11:43 AM, stephenacross@gmail.com wrote:
> This works on my local machine, when I move it out to RailsPlayground
>>> 14:     <%=  time_select('task', 'start_at') %>
>>
>> How is the start_at field in your tasks table defined?
>>
>> Bill

Just a caution about a column named "desc".  Since that matches an
SQL keyword (as in "select * from tasks order by start_at DESC"), you
may run into trouble later if there's ever a time where the column
name isn't properly quoted.

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
This topic is locked and can not be replied to.