Hi there, I''m new to Rails -- started with this project just about five days ago -- I''m re-building an in-house ordering tool, and it would be handy to pre-populate a date_select field with a value two weeks from now. The calculation isn''t the hard part, it''s getting date_select to pre-populate itself. Any suggestions? Thanks, --Jim
Jim Zajkowski wrote:> I''m new to Rails -- started with this project just about five days ago > -- I''m re-building an in-house ordering tool, and it would be handy to > pre-populate a date_select field with a value two weeks from now. The > calculation isn''t the hard part, it''s getting date_select to > pre-populate itself. > > Any suggestions?in controller (app/controllers/models_controller.rb): def new @model = Model.new @model.sometime = 2.weeks.from_now end in view (app/views/models/new.rhtml): <%= date_select ''model'', ''sometime'' %> jeremy