From 56b8b11ff2b673005ad2044672f2eb215a905bba Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 18 Dec 2023 20:06:01 +0000 Subject: Fixed the problem with the select method... --- app/models/organisation.rb | 2 +- app/views/events/_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/organisation.rb b/app/models/organisation.rb index aa67564..89ad982 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -1,3 +1,3 @@ class Organisation < ApplicationRecord - has_many :events + has_many :events, dependent: :destroy end diff --git a/app/views/events/_form.html.erb b/app/views/events/_form.html.erb index 98dd972..dbce3b1 100644 --- a/app/views/events/_form.html.erb +++ b/app/views/events/_form.html.erb @@ -39,7 +39,7 @@
<%= form.label "Organisation", style: "display: block" %> - <%= form.select :organisation, Organisation.all.collect { |o| [ o.name, o.id ] }, include_blank: true %> + <%= form.select :organisation_id, Organisation.all.collect { |o| [ o.name, o.id ] }, include_blank: true %>
-- cgit v1.2.3