I added this in groups_controller because my prefer is to have all the queries from models in the controller and not in the views.