From 5a7ec8c0d9b4260e2839c42077ebd0e588b74a0f Mon Sep 17 00:00:00 2001 From: Alexandria Date: Mon, 24 Jan 2022 19:15:30 +0000 Subject: [PATCH] Not sure why rebasing removed the policy_scope change. Otherwise this is 99% ready lol --- app/controllers/admin/sites_controller.rb | 2 +- app/views/admin/sites/_form.html.erb | 1 + app/views/admin/sites/_sites_neighbourhood_fields.html.erb | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 8d00a1308..806c15fbd 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -58,7 +58,7 @@ def set_site end def set_variables_for_sites_neighbourhoods_selection - @all_neighbourhoods = policy_scope(Neighbourhood).order(:name).where(unit: 'ward') + @all_neighbourhoods = policy_scope(Neighbourhood).order(:name) begin set_site rescue ActiveRecord::RecordNotFound diff --git a/app/views/admin/sites/_form.html.erb b/app/views/admin/sites/_form.html.erb index 56642981c..46566920d 100644 --- a/app/views/admin/sites/_form.html.erb +++ b/app/views/admin/sites/_form.html.erb @@ -68,6 +68,7 @@ +

<%= f.button :submit, class: "btn btn-primary " %> diff --git a/app/views/admin/sites/_sites_neighbourhood_fields.html.erb b/app/views/admin/sites/_sites_neighbourhood_fields.html.erb index 1de41af06..2c532f803 100644 --- a/app/views/admin/sites/_sites_neighbourhood_fields.html.erb +++ b/app/views/admin/sites/_sites_neighbourhood_fields.html.erb @@ -1,5 +1,7 @@
- <%= f.input :name, collection: options_for_sites_neighbourhoods, include_blank: false %> + <%= f.input :name, collection: options_for_sites_neighbourhoods, include_blank: false, + input_html: { class: 'form-control' } %> <%= f.hidden_field :relation_type, value: 'Secondary' %> <%= link_to_remove_association 'Remove Secondary Neighbourhood', f, class: "btn btn-danger" %> +