passing a parameter from an other model on ruby

Posted by MAGE on Stack Overflow See other posts from Stack Overflow or by MAGE
Published on 2010-06-13T13:05:36Z Indexed on 2010/06/13 13:12 UTC
Read the original article Hit count: 153

Filed under:

I'm very newbie in ruby and need your help.

I must save a "Topic" and make it like this :

@topic = Topic.new(params[:topic])

But I would like to pass an other information to this topic. It has a field "community_id" that link it to a community. The logged user has this information on his table.

How can I pass the "community_id" from the logged user to the "community_id" of the "topic" created ?

thx for your help

© Stack Overflow or respective owner

Related posts about ruby-on-rails