Rails querying with an array -
so in controller made page shows group_pages(the scaffold) in array @group_post_users contain current user so:
def my_group @group_pages = grouppage.all @group_pages.each |group_page| @group_page_users = group_page.page_users.split(',') @group_page_users.push(group_page.user.email) @mg_users = user.find_by_email(@group_page_users) @gg_users = user.where(:email => @group_page_users) group_page.super_uses = @gg_users @g_pages = grouppage.where(:super_uses => @selected_posts.map(&:id)) end end
now have array of users group_page in @group_page_users , want show group pages contain current user inside @group_page
basically want :
@g_pages = grouppage.where(:super_uses => current_user.email)
Comments
Post a Comment