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
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: <at> caseid = session[:case_id] <at> report = Report.find(:all, :conditions => "case_id = ''#{ <at> 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>
Possibly Parallel Threads
- ROR questions
- Relationships: one model referencing same table for different data sets?
- In datetime_select, :order does not work, but it works for date_select Why
- specifying m/d/y order in datetime_select
- Small Date Formatting Question regarding datetime_select()