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/ckeditor/attachment_file.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/models/ckeditor/attachment_file.rb (limited to 'app/models/ckeditor/attachment_file.rb') diff --git a/app/models/ckeditor/attachment_file.rb b/app/models/ckeditor/attachment_file.rb new file mode 100644 index 0000000..fe09132 --- /dev/null +++ b/app/models/ckeditor/attachment_file.rb @@ -0,0 +1,13 @@ +class Ckeditor::AttachmentFile < Ckeditor::Asset + has_attached_file :data, + url: '/uploads/attachments/:id/:filename', + path: ':rails_root/public/uploads/attachments/:id/:filename' + + validates_attachment_presence :data + validates_attachment_size :data, less_than: 100.megabytes + do_not_validate_attachment_file_type :data + + def url_thumb + @url_thumb ||= Ckeditor::Utils.filethumb(filename) + end +end -- cgit 1.4.1