I want to set the values of several record fields from within an
iterator where the field name is passed as a parameter.  For example
(conceptually):

# Line numbers are for reference only and are not a part of the code.
1.      record=Model.find(id)
2.      params.each do |key,value|
3.        eval('record.'+key)=value
4.      end

Apparently, having the eval on the LHS of an assignment doesn't work.
Can anyone please tell me what would work?

Thanks for any input.

         ... doug

--

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-t...@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.


Reply via email to