I have a couple questions about created_on and updated_on fields. 1) Why are these fields both displayed as editable on the default new/edit templates? Is it just because they are basic, and meant to be replaced with a more "useable" implementation? 2) The updated_on field works as expected, and regardless of whether the updated_on value is altered on the client side and submitted, the server always specifies the true date/time of the update. created_on, however, allows any value to be specified at any time for it, both when new, and when being edited. Is there a configuration setting I''m missing to dissallow the manipulation of the created_on value? It seems to me like this should not be a user-modifiable value, and that it should only be set when the record is created. Thanks, Steve
Hey Steve, I''m assuming the reason it''s displayed with the default scaffolding is simply because the scaffolded code retrieves all fields from the database and builds a form field. You can simply remove those two fields from the HTML form. Hope that helps... On Apr 4, 2005 3:13 PM, Steve V <ruby-ChEX1j9zMF7JbC0vcoRRxNBPR1lH4CV8@public.gmane.org> wrote:> I have a couple questions about created_on and updated_on fields. > > 1) Why are these fields both displayed as editable on the default new/edit > templates? Is it just because they are basic, and meant to be replaced with > a more "useable" implementation? > > 2) The updated_on field works as expected, and regardless of whether the > updated_on value is altered on the client side and submitted, the server > always specifies the true date/time of the update. created_on, however, > allows any value to be specified at any time for it, both when new, and when > being edited. Is there a configuration setting I''m missing to dissallow the > manipulation of the created_on value? It seems to me like this should not be > a user-modifiable value, and that it should only be set when the record is > created. > > Thanks, > Steve > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Frank FrankManno.com <a href="http://www.spreadfirefox.com/?q=affiliates&id=2496&t=1">Get Firefox!</a>
> > 2) The updated_on field works as expected, and regardless of whether the > > updated_on value is altered on the client side and submitted, the server > > always specifies the true date/time of the update. created_on, however, > > allows any value to be specified at any time for it, both when > new, and when > > being edited. Is there a configuration setting I''m missing to > dissallow the > > manipulation of the created_on value? It seems to me like this > should not be > > a user-modifiable value, and that it should only be set when > the record is > > created.> I''m assuming the reason it''s displayed with the default scaffolding is > simply because the scaffolded code retrieves all fields from the > database and builds a form field. You can simply remove those two > fields from the HTML form.That''s more or less what I figured the case was. Not really a big deal, just seemed a little strange since they were special purpose fields. What about question number 2? Does anyone have an answer to this? Is the only option to mark the created_on field as protected and implement my own restrictions in every single class that''s created? Thanks, Steve