Getting undefined method time_select

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.

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

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.

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

Thank you 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