%= form_with(model: house_qec_share_person, local: true) do |form| %> <%= render partial: "shared/show_errors", locals: {record: house_qec_share_person} %> <% pundit_house_id = pundit_user.user.person.house_id %> <%= edit_table_open %> <% if !pundit_user.has_house_policyscope?(HouseQecSharePerson) %> <% person = Person.all.ordered_by_name %> <% houseqecshare = HouseQecShare.all.ordered_for_calc %> <% else %> <% person = Person.belong_to_house(pundit_house_id).ordered_by_name %> <% houseqecshare = HouseQecShare.belong_to_house(pundit_house_id).ordered_for_calc %> <% end %> <%= edit_table_row (form.label :house_qec_share_id), (form.collection_select(:house_qec_share_id, houseqecshare, :id, :format_for_formselect, include_blank: true) ) %> <%= edit_table_row (form.label :person_id), (form.collection_select(:person_id, person, :id, :format_for_formselect, include_blank: true) ) %> <%= edit_table_row (form.label :share), (form.number_field :share, id: :house_qec_share_person_share) %> <%= edit_table_close %>