Created
February 10, 2012 08:35
-
-
Save rubytastic/1787817 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_many :assets, :as => :attachable | |
accepts_nested_attributes_for :assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= 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