This question pops in and out of the mailing list and I’m wondering
others have solved it. Consider the case where the user is filling out a
form but there is no underlying database record (say the contents of the
form are emailed someplace then discarded).
It would be great to use:
<%= text_field(:my_fine_form, ‘last_name’) %>
<%= text_field(:my_fine_form, ‘first_name’) %>
Then have params[:my_fine_form] automagically populate some object just
it does the model. E.g.,
@my_fine_data = MyFineForm.find() # populates from
redirect_to :action => ‘entry_form’ unless @my_fine_data.valid?
And even cooler, a form model:
def MyFineForm < ActiveForm
:persists_in_session => true;
and blah, blah, blah
I’d write this myself – I may even have to – but I wanted to make sure
nobody else already has.