I have this controller code: ... field_array.each do |f| f = f.to_sym model.send("#{f}=", "#{parm_hash[f]}") if model.attribute_present?(f) end return model ...
field_array is an array of attribute names as strings. parm_hash is the params hash returned from the view associated with model. If the value associated with an attribute_key is anything but a date then this works and the value is set. If the value is a date then it sets nil instead. Can anyone see what I am doing wrong? -- Posted via http://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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---