Forum: Ruby on Rails Dealing with created_on and updated_on ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4b0889adddec0b9bae5435e0c233b1e3?d=identicon&s=25 Davo (Guest)
on 2007-02-27 08:57
(Received via mailing list)
Hi everyone,

I'm working through some of the books and all going fairly well...

But I'm just wondering why when you create a scaffold for a table why
it includes created_on/at and updated_on/at fields for the create and
edit modes ?

As these are internally updated fields they should not be exposed to
user access...

So how do I now take them out of the forms & let them create/update
themselves ?

TIA - Dave Porter
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2007-02-27 09:20
(Received via mailing list)
Hi Dave, how did you create these model(s)?  Did you mean the create
and edit actions for the controller?  In any case, you simply remove
this information from the view in question.

Good luck,

125639ddcc0b9119bb84e29416ace63a?d=identicon&s=25 Scott (Guest)
on 2007-02-27 14:20
(Received via mailing list)
created_on/at updated_on/at are magic column names used by
ActiveRecord. They store the date/date+time when the table for the
corresponding object is created/updated.

You sholdn't need them in the form at all. Those fields will be
updated automatically when you create, save, etc. on the model


Have a look at the migration for the table. Yo
This topic is locked and can not be replied to.