How about:

@meta.send("#{field}=", content)

Jamey


On Fri, Jul 10, 2009 at 4:31 PM, Dan
Berger<[email protected]> wrote:
>
> I'm calling this action from within another action:
>
> edit_meta(@table_meta_id, @field, @content)
>
> where @field is an attribute name for a Model. @table_meta_id is the id
> and @content is the new value for that attribute.
>
> The edit_meta action looks like this:
>
> def edit_meta(id, field, content)
>
>   �...@meta = Model.find(:all, :conditions => ["id = ?", id])
>   �[email protected] = content
>   �[email protected]_at = now()
>   �[email protected]
>
> end
>
> Problem is that I can't figure out how to get the field argument to tell
> my model which attribute I want to change. I just get a "NoMethodError".
> How do I do that?
>
> Thanks!
> --
> 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to