Skip to content

Commit

Permalink
Not sure why rebasing removed the policy_scope change. Otherwise this…
Browse files Browse the repository at this point in the history
… is 99% ready lol
  • Loading branch information
lexiwitch committed Jan 24, 2022
1 parent 811b31a commit 5a7ec8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/sites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/sites/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<div class="links">
<%= link_to_add_association 'Add secondary', f, :sites_neighbourhoods, class: "btn btn-primary" %>
</div>
<br></br>
</div>

<%= f.button :submit, class: "btn btn-primary " %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/admin/sites/_sites_neighbourhood_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div class="nested-fields">
<%= 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" %>
<br></br>
</div>

0 comments on commit 5a7ec8c

Please sign in to comment.