There are three tables, one called company , another group and a subgroup call, / em> , a form, in this form I use simple_form to show a combobox with groups, but all come the groups and need to filter the groups of each company, how to do?
There are three tables, one called company , another group and a subgroup call, / em> , a form, in this form I use simple_form to show a combobox with groups, but all come the groups and need to filter the groups of each company, how to do?
Answering my own question :-p
= f.association :group,
collection: Group.where('company_id = ?', current_user.company_id), selected: @subgroup.group_id