Class: Wafflemix::Asset

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/wafflemix/asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path.



8
9
10
# File 'app/models/wafflemix/asset.rb', line 8

def path
  @path
end

Instance Method Details

#to_jq_uploadObject

one convenient method to pass jq_upload the necessary information



11
12
13
14
15
16
17
18
19
20
# File 'app/models/wafflemix/asset.rb', line 11

def to_jq_upload
  {
    "name" => read_attribute(:asset_name),
    "size" => asset_size,
    "url" => asset_url,
    "thumbnail_url" => asset.thumb('80x80#').url,
    "delete_url" => Wafflemix::Engine::routes.url_helpers.admin_asset_path(:id => id),
    "delete_type" => "DELETE"
  }
end