Article:
  Rolling with Ruby on Rails
Subject:   Editing date
Date:   2005-08-10 12:11:02
From:   rubyonrails
You dont have how, when writing the file edit.rhtml, to write the script for when you want to edit the date. I have tried many different methods but nothing works for me.
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Curt Hibbs photo Editing date
    2005-08-10 12:48:13  Curt Hibbs | O'Reilly AuthorO'Reilly Blogger [View]

    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.