ruby on rails - build relationship from list of ids -


Hello, I have is_and_bollongs_to_me relationship between posts and comments and in my editing action I have a The form that gives me the list of IDs 1,3,5,8 etc. I want to create relationships between my existing models and all the models which are in the Aids list, so @ post.comments 1,3,5,8 ids

< P> Returns the comments with in fact I need to execute

  Delete from comments_posts WHERE post_id = @ post.id comments_post Enter the values ​​(1, @post.id) (3, @ Post (5, @ Post.id) (8, Post.id) or   Post-text "itemprop =" text "> 
  absolute [: list] || = [] # Create an empty array via form is empty @ posts.comment_ids = consult [list:] #Remember organizations open again  


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -