Form woes

I have a form which generates a report. The first issue I ran into was
trying to create a model to validate some of the entries without saving
them....that didnt' work out too well, so I created a report table. I
figured uses could save reports for later viewing as a feature.

The form has two field names: report for fields pertaining to the
report and :check which are fields not being saved. The check fields
have names like: "use_agreed_to_participate" which let me know to use
the data in that field to filter by. Here's a snippet:

<div class='reportRow' >

  <div class='reportLeftCell'>

   Schedule Date


  <div class='reportCenterCell' id='reportScheduleSelects'>


    <%= datetime_select('report', 'schedule_date_to') %><br /><br />

    <%= datetime_select('report', 'schedule_date_from') %>


  <div class='reportRightCell'>

    <%= check_box('check','use_schedule_date', :checked_value => "1",
:unchecked_value => "0") %>


Everything works perfect unless my Report object throws an error on
save which brings you back to the form page.

Error snippet:

Showing app/views/admin/_report_form.rhtml where line #31 raised:

undefined method `use_updated_on' for

Extracted source (around line #31):

28: <%= datetime_select('report', 'updated_on_to') %>
29: </div>
30: <div class='reportRightCell'>
31: <%= check_box('check','use_updated_on', :checked_value => "1",
:unchecked_value => "0") %>
32: </div>
33: </div>

The trace:
#{RAILS_ROOT}/app/controllers/admin_controller.rb:39:in `new_report'

And finally, liine #39 in new_report:

35 @report =

36 if

37 redirect_to :action => :show_report, :id => @report[:id]

38 else

39 render :action => 'report'

40 end

I know I'm probably missing something simple here and it has something
to do with use_updated_on (and friends) not having a model backend..but
is there an elegant way to fix this without hacking rails source or
some such?

As usual, as soon as I take the time to submit to list I find the
answer. So I'll answer it here:

Please look into attr_accessor setting for your model.


I am having the same problem, except with radio buttons, and I don't
understand how you solved it with an attr_accessor. Could you explain
a bit more in depth?


Actually I also figured it out right after I sent the email... and
truly all I needed was the attr_accessor... so thanks!