aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-12-18 20:06:01 +0000
committerMatthew Lemon <y@yulqen.org>2023-12-18 20:06:01 +0000
commit56b8b11ff2b673005ad2044672f2eb215a905bba (patch)
tree40eb44d5dc922b8cc87f4705c0a428ce3c9a2345
parent8185939b2629581dd9264dbbc37f859e19436f31 (diff)
Fixed the problem with the select method...
-rw-r--r--app/models/organisation.rb2
-rw-r--r--app/views/events/_form.html.erb2
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 @@
<div>
<%= 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 %>
</div>
<div>