No. This is the right way to do it. Data type matches are necessary for functionality, you can't ignore those.
On Sep 2, 3:45 pm, Quee Mm <[email protected]> wrote: > Well it turns out that it was a string vs integer issue. I have my > fields in db as string and the code was generating a integer so that > caused issues at edit time. > > I made the following change and now it seems to work. > > <%= f.select(:year_made, ((1980..Time.now.year).collect {|p| [ p.to_s, > p.to_s ]}).reverse, {:prompt=>"Select a Year"}) %> > > Does anyone else have a better idea on how to do this? > > --------------------------- > > > > Colin Law wrote: > > 2009/8/31 Quee Mm <[email protected]>: > >> For Edit > >>http://pastie.org/600226 > > >>> Have you checked that year_made contains the previous value. Possibly > >>> put <%= @object.year_made %> in the form to check. > >> Yes it does. > > > Odd, it all looks ok to me. Is year_made an integer or a string? I > > wonder whether it is expecting an integer as all my uses have always > > been with an id value. > > > Any other ideas anyone? > > > Colin > > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

