Skip to content

Commit

Permalink
Fix cocoon
Browse files Browse the repository at this point in the history
  • Loading branch information
kimadactyl committed Jan 21, 2022
1 parent dcb52fe commit a254c82
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/models/sites_neighbourhood.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ class SitesNeighbourhood < ApplicationRecord
scope: :site_id,
message: 'Neighbourhood cannot be assigned more than once to a site'
}

def name
neighbourhood.to_s
end
end
6 changes: 3 additions & 3 deletions app/views/admin/sites/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
collection: options_for_sites_neighbourhoods,
input_html: {class: 'form-control select2' } %>

<%= f.simple_fields_for :site__neighbourhoods do |neighbourhood| %>
<%= render 'sites_neighbourhoods', :f => neighbourhood %>
<%= f.simple_fields_for :sites_neighbourhoods do |neighbourhood| %>
<%= render 'sites_neighbourhood_fields', :f => neighbourhood %>
<% end %>
<div class="links">
<%= link_to_add_association 'Add secondary neighbourhood', f, :site__neighbourhoods %>
<% link_to_add_association 'Add secondary neighbourhood', f, :sites_neighbourhoods %>
</div>
</div>

Expand Down
2 changes: 0 additions & 2 deletions app/views/admin/sites/_sites_neighbourhood_fields.erb

This file was deleted.

0 comments on commit a254c82

Please sign in to comment.