ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Rolling with Ruby on Rails
Subject:   Editing date
Date:   2005-08-10 12:48:13
From:   curth
Response to: Editing date

You can look at the code the Rails uses to edit dates by actually generating the scaffold code (I don't cover this in the article).


Create a dummy table in your database (call it,say, "foobars"), and besides the id field, add a date field. Then run the command in the root directory of you cookbook:


ruby scripts/generate scaffold foobars


This will actually create the model, controller, and view templates, letting you see exactly how Rails implements it.