diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 13:03:43 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 13:03:43 -0400 |
commit | e47e83cf6bded3d1924b4d500193e7876833ef83 (patch) | |
tree | 058f011637e67455dcd8451fbfa784b5883c6f69 /app/models/entry.rb | |
parent | 528ccde8915cd1ed7a39e137dd4d98869797956a (diff) | |
download | thoughts-e47e83cf6bded3d1924b4d500193e7876833ef83.tar.gz thoughts-e47e83cf6bded3d1924b4d500193e7876833ef83.tar.bz2 thoughts-e47e83cf6bded3d1924b4d500193e7876833ef83.zip |
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 :(
Diffstat (limited to 'app/models/entry.rb')
-rw-r--r-- | app/models/entry.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ | |||
1 | class Entry < ApplicationRecord | 1 | class Entry < ApplicationRecord |
2 | has_many :records, as: :recordable | 2 | has_many :records, as: :recordable, inverse_of: :recordable |
3 | 3 | ||
4 | validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ | 4 | validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ |
5 | 5 | ||
6 | accepts_nested_attributes_for :records, allow_destroy: true | ||
7 | |||
6 | def path | 8 | def path |
7 | "/says/#{slug}" | 9 | "/says/#{slug}" |
8 | end | 10 | end |