%= form_with(model: house_qec_share, local: true) do |form| %> <%= render partial: "shared/show_errors", locals: {record: house_qec_share} %> <% if house_qec_share.id.blank? && house_qec_share.house_account_id.blank? %> <% house_qec_share.house_account_id = @filter_params[:filterhouseaccount_id] %> <% end %> <% pundit_house_id = pundit_user.user.person.house_id %> <%= edit_table_open %> <% if !pundit_user.has_house_policyscope?(HouseQecShare) %> <%= edit_table_row (form.label :house_id), (form.collection_select :house_id, House.all.ordered_by_name, :id, :format_for_formselect, include_blank: true) %> <% else %> <%= form.hidden_field :house_id, :value => pundit_house_id %> <% end %> <%= edit_table_row (form.label :house_account_id), (form.collection_select(:house_account_id, HouseAccount.all.ordered_by_name, :id, :format_for_formselect, include_blank: true) ) %> <% if house_qec_share.id.blank? %> <%= edit_table_row (form.label 'Tipologia predefinita'), select_tag("do_what", options_for_select( HouseQecSharesHelper::HouseQecSharesTemplateOptions, params[:do_what].present? ? params[:do_what] : nil ), prompt: '(scegli la tipologia predefinita)', include_blank: true, ) %> <% end %> <%= edit_table_close %>