Skip to content

Instantly share code, notes, and snippets.

@rubytastic
Created February 10, 2012 08:35
Show Gist options
  • Save rubytastic/1787817 to your computer and use it in GitHub Desktop.
Save rubytastic/1787817 to your computer and use it in GitHub Desktop.
# == Schema Information
#
# Table name: assets
#
# id :integer(4) not null, primary key
# description :text
# file :string(255)
# attachable_id :integer(4)
# attachable_type :string(255)
# created_at :datetime
# updated_at :datetime
#
class Asset < ActiveRecord::Base
attr_accessible :description,
:file,
:file_cache
belongs_to :attachable,
:polymorphic => true
mount_uploader :file, AssetUploader
end
has_many :assets, :as => :attachable
accepts_nested_attributes_for :assets
//= link_to image_tag(profile.avatar.url(:photo), :id => 'tooltip', :title => 'tooltip html', :width =>'108', :height =>'108' ), profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment