RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: iloveror
who can help me?
class Attachment < ActiveRecord::Base has_attached_file :att, :url => "/files/:class/:id/:style/:basename.:extension", :path => ":rails_root/public/files/systems/:id/:style/:basename.:extension" end
class UserLogo < Attachment has_one :user has_attached_file :att, :styles => { :original => "100x100>" } , :url => "/files/:class/:id/:style/:basename.:extension", :path => ":rails_root/public/files/user_logos/:id/:style/:basename.:extension"
validates_attachment_content_type :att, :content_type => ['image/png','image/jpg','image/bmp','image/jpeg','x-png','pjpeg'] end
who can help me?
class Attachment < ActiveRecord::Base
has_attached_file :att,
:url => "/files/:class/:id/:style/:basename.:extension",
:path => ":rails_root/public/files/systems/:id/:style/:basename.:extension"
end
class UserLogo < Attachment
has_one :user
has_attached_file :att,
:styles => { :original => "100x100>" } ,
:url => "/files/:class/:id/:style/:basename.:extension",
:path => ":rails_root/public/files/user_logos/:id/:style/:basename.:extension"
validates_attachment_content_type :att,
:content_type => ['image/png','image/jpg','image/bmp','image/jpeg','x-png','pjpeg']
end