Changeset 1239
- Timestamp:
- 07/24/08 17:31:32 (6 months ago)
- Files:
-
- trunk/app/models/image.rb (modified) (1 diff)
- trunk/app/models/show.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/models/image.rb
r1201 r1239 1 1 class Image < ActiveRecord::Base 2 3 liquid_methods :width, :height 4 2 5 belongs_to :show 3 6 has_attachment :storage => :file_system, :max_size => 300.kilobytes, :content_type => :image, :thumbnails => { :normal => '200>', :thumb => '75' } 4 7 validates_as_attachment 5 8 end 9 10 class Image::LiquidDropClass 11 12 def url_for 13 view.image_path @object.public_filename(:normal) 14 end 15 16 def url_for_thumb 17 view.image_path @object.public_filename(:thumb) 18 end 19 20 def tag 21 view.image_tag @object.public_filename(:normal) 22 end 23 24 def tag_for_thumb 25 view.image_tag @object.public_filename(:thumb) 26 end 27 28 end trunk/app/models/show.rb
r1236 r1239 4 4 belongs_to :template 5 5 6 liquid_methods :name, :description, :episodes 6 liquid_methods :name, :description, :episodes, :logo 7 7 8 8 def after_initialize
