On 2 Oct 2008, at 18:50, Jonas Schneider wrote:
>
> Hey guys,
>
> I have a Comment model which belongs_to a Post and a User model.
> Now I want to be able to build a comment for this User and this Post.
> Does it really have to go like this:
>
> @comment = @idea.comments.build
> @comment.user = current_user
>
well you can do @idea.comments.build :user => current_user
but that''s about it as far as I know (and barring dirty tricks with
with_scope)
Fred> Is there a better way to do this?
>
> Thanks,
> Jonas
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---