Alex Fenton
11/27/2007 12:04:00 PM
Bober wrote:
> @invo = Post.find(params[:id])
> @a = @invo.attributes
>
> @a.each { |m, n|
> @invo.m = "new_value"
> }
>
> But, I see "undefined method `m=' "
Because you are calling the literal method "m=", which doesn't exist.
You want instead, something like (untested, I don't use ActiveRecord).
@invo.send("#{m}=", "new_value")
alex