From e47e83cf6bded3d1924b4d500193e7876833ef83 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 2 Jul 2017 13:03:43 -0400 Subject: Created admin panel Currently allows you to create and edit blogs, including associated records. Uses a WYSIWYG editor that allows uploading images. Also included jQuery :( --- app/models/entry.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models/entry.rb') diff --git a/app/models/entry.rb b/app/models/entry.rb index 22b330a..87fd46d 100644 --- a/app/models/entry.rb +++ b/app/models/entry.rb @@ -1,8 +1,10 @@ class Entry < ApplicationRecord - has_many :records, as: :recordable + has_many :records, as: :recordable, inverse_of: :recordable validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ + accepts_nested_attributes_for :records, allow_destroy: true + def path "/says/#{slug}" end -- cgit 1.4.1