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.
--
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
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
-~----------~----~----~----~------~----~------~--~---