Array

newbie…

in this line of code i get all the group id’s, once they were picked
up(by checkboxes).

def send_email
groups = []                     #new array
users = []                      #new array
groups << params[:group_ids]    #group id's
groups.each { | g |             #loop for each group id
users << g                      #insert the id of the groups into Array
}

help:
i want to get to users, who has the same id’s of “group_ids”(group id’s)
(user can be assosiated with many groups)

example:

groups[magazine1, magazine2…]

users[yoni, dan…]

magazine1 (id=>1, title=>magazine, body…)

yoni (id=>1, group_id=>1)

how do i get the user “yoni”, with “group_id=>1”, and put the user under
Array

  • i already have a table “groups_users”, and don’t have a problem
    connecing the two’s. i need to place all the users under Array(with the
    same group_ids).

thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs