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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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, -Conrad On 2/26/07, Davo <Dave.SouthPerth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > 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 > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 object. Scott Have a look at the migration for the table. Yo On Feb 27, 2:56 am, "Davo" <Dave.SouthPe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---