mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-12 23:46:15 +01:00
add attachment model and add paperclip
This commit is contained in:
parent
013b260a1b
commit
76de5bf2b3
8 changed files with 78 additions and 22 deletions
10
app/models/attachment.rb
Normal file
10
app/models/attachment.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class Attachment < ActiveRecord::Base
|
||||
belongs_to :todo, touch: true
|
||||
|
||||
has_attached_file :file,
|
||||
url: '/:class/:id/:basename.:extension',
|
||||
path: ":rails_root/db/assets/#{Rails.env}/:class/:id/:basename.:extension"
|
||||
|
||||
do_not_validate_attachment_file_type :file
|
||||
# validates_attachment_content_type :file, :content_type => ["text/plain"]
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue