Sha256: 1beb4d16ce354f8d2bf5da0184b5b511fa42fdf98a5a4ff850deeeddcd985255

Contents?: true

Size: 450 Bytes

Versions: 18

Compression:

Stored size: 450 Bytes

Contents

module Orange
  class Asset < Orange::Carton
    id
    admin do
      title :name
      text :caption
    end
    orange do
      string :path, :length => 255
      string :mime_type
      string :secondary_path, :length => 255, :required => false
      string :secondary_mime_type
    end
    
    def file_path
      File.join('', 'assets', 'uploaded', path)
    end
    
    def to_asset_tag
      "<img src=\"#{file_path}\" />"
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
orange-0.2.6 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.2.5 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.2.4 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.2.3 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.10 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.8 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.7 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.4 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.2 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.1.0 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.0.15 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.0.14 lib/orange-more/assets/cartons/asset_carton.rb
orange-0.0.13 lib/orange/cartons/asset_carton.rb
orange-0.0.12 lib/orange/cartons/asset_carton.rb
orange-0.0.10 lib/orange/cartons/asset_carton.rb
orange-0.0.8 lib/orange/cartons/asset_carton.rb
orange-0.0.7 lib/orange/cartons/asset_carton.rb
orange-0.0.6 lib/orange/cartons/asset_carton.rb