Added carousel model
This commit is contained in:
parent
069cc0eb4c
commit
d9818f2749
6 changed files with 72 additions and 11 deletions
11
app/models/photo.rb
Normal file
11
app/models/photo.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class Photo < ActiveRecord::Base
|
||||
attr_accessible :picture, :description
|
||||
belongs_to :conference
|
||||
validates_presence_of :picture
|
||||
has_attached_file :picture,
|
||||
styles: { thumb: '100x100>', large: '300x300>' }
|
||||
|
||||
validates_attachment_content_type :picture,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue