diff --git a/app/models/sites_neighbourhood.rb b/app/models/sites_neighbourhood.rb index 7656ca50f..1c5d5e4c7 100644 --- a/app/models/sites_neighbourhood.rb +++ b/app/models/sites_neighbourhood.rb @@ -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 diff --git a/app/views/admin/sites/_form.html.erb b/app/views/admin/sites/_form.html.erb index bf892ab7e..877b01bb0 100644 --- a/app/views/admin/sites/_form.html.erb +++ b/app/views/admin/sites/_form.html.erb @@ -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 %>