Using the Rails Environment URL in a MODEL with paperclip
问题 in my users model I have a paperclip setup like this: has_attached_file :profile_pic, :styles => {:large => "300x300>", :medium => "150x150>", :small => "50x50#", :thumb => "30x30#" }, :default_style => :thumb, :default_url => '/images/:attachment/default_:style.png', How do I make the default URL, include the full URL? http://0.0.0.0:3000/images/:attachment/default_:style.png or http://sitename.com/images/:attachment/default_:style.png 回答1: In Rails 3 add: include Rails.application.routes