Add venue_photos model and venue_photos admin controller in order to add more images to Venues and allow to delete it.

Show the additional photos in splash. Added fancybox gem for zoom when click on the additional photo.

fix #777
This commit is contained in:
David Sedeño 2016-02-13 17:12:03 +01:00
parent 2034c0f965
commit 7c0cd30dda
13 changed files with 85 additions and 7 deletions

View file

@ -1,6 +1,7 @@
class Venue < ActiveRecord::Base
belongs_to :conference
has_many :rooms, dependent: :destroy
has_many :venue_photos, dependent: :destroy
before_create :generate_guid
validates :name, :street, :city, :country, presence: true

View file

@ -0,0 +1,9 @@
class VenuePhoto < ActiveRecord::Base
belongs_to :venue
has_attached_file :photo,
styles: { thumb: '100x100>', large: '300x300>' }
validates_attachment_content_type :photo,
content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes }
end