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/ckeditor/attachment_file.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/ckeditor/attachment_file.rb')
| -rw-r--r-- | app/models/ckeditor/attachment_file.rb | 13 |
1 files changed, 13 insertions, 0 deletions
| 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 @@ | |||
| 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset | ||
| 2 | has_attached_file :data, | ||
| 3 | url: '/uploads/attachments/:id/:filename', | ||
| 4 | path: ':rails_root/public/uploads/attachments/:id/:filename' | ||
| 5 | |||
| 6 | validates_attachment_presence :data | ||
| 7 | validates_attachment_size :data, less_than: 100.megabytes | ||
| 8 | do_not_validate_attachment_file_type :data | ||
| 9 | |||
| 10 | def url_thumb | ||
| 11 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) | ||
| 12 | end | ||
| 13 | end | ||
