How to make a hidden datetime selector?

Hi, could you explain what you’re trying to do because this will allow others to better assist you? It seems that you would like the datetime set automatically. If this is the case, then you want to remove the date selection from the form because the created_at field will automatically set by the rails framework. Please read section, “Magic Column Names”, on page 319 of AWDwRv2.

Good luck,


Hi, I would highly recommend the following book:

Agile Web Development with Rails 2 Edition

You’ll want to complete Part II of this book and this will provide you with a good foundation to build from. Lastly, you can order the PDF and/or paperback from

Good luck,


Don't bother putting it in your form at all. You can do that server
side. The model is the best place for it, you can use a before filter
to execute all sorts of stuff, but in your case. In your post.rb model

before_create :set_time

def set_time
self.created_at =

In saying all this however, check if rails 2.0 automatically fills
this is for you. Try creating and saving a new record in the console,
as I'm pretty sure that Rails will fill in this field automatically.

over 'n out