Datetime_select problems

Hi,

I have a datetime select in my form like this:

DATE/TIME REPORTED: <%= datetime_select ‘report’, ‘rep_date’ %>

This works beautifully for creating a new record. The data is saved as:

2006-08-07 11:33:00

Now, the problem is when I try to load the form with saved values
to do an update.

The above code works and loads the saved data in another one of
my update forms, and the only difference is that with this form,
the one that won’t work, I have my form data retrieval in a do loop,
because I did not search by id in my controller.
I am instead searching by my session variable (case_id),
which I understand returns an array, so I need the loop:

@caseid = session[:case_id]
@report = Report.find(:all, :conditions => “case_id = ‘#{@caseid}’”)

Could the presence of a do loop cause the datetime_select to
not function properly?

Any help always appreciated! :slight_smile:

Thank you!
Ali Williams

Ali Williams <awilliams@…> writes:

Hi,

I have a datetime select in my form like this:

DATE/TIME REPORTED: <%= datetime_select ‘report’, ‘rep_date’ %>

This works beautifully for creating a new record. The data is saved
as:

2006-08-07 11:33:00

Now, the problem is when I try to load the form with saved values
to do an update.

The above code works and loads the saved data in another one of
my update forms, and the only difference is that with this form,
the one that won’t work, I have my form data retrieval in a do loop,
because I did not search by id in my controller.
I am instead searching by my session variable (case_id),
which I understand returns an array, so I need the loop:

caseid = session[:case_id]
report = Report.find(:all, :conditions => “case_id = ‘#{
caseid}’”)

Could the presence of a do loop cause the datetime_select to
not function properly?

Any help always appreciated!

Thank you!
Ali Williams

PS - Guess it would be helpful to know that the error I’m getting is:

undefined method `rep_date’ for #Array:0xb7490e40