title: Paperclip URL helper providing wrong URL when using S3
body: <p>I am using the Paperclip gem with Rails to upload images, and when I use the img tag helper with the gem it outputs the wrong URL. Here is the model code:</p>
  
  <pre><code>class Org &lt; ActiveRecord::Base
      has_many :event
      has_many :solookup
      belongs_to :student
  
      has_attached_file :org_pic, :styles =&gt; { :medium =&gt; "300x300&gt;", :thumb =&gt; "100x100&gt;" }, :default_url =&gt; "/assets/clubhouse.jpg", :storage =&gt; :s3, :s3_credentials =&gt; Proc.new{|a| a.instance.s3_credentials}, :s3_host_name =&gt; "branchapp.s3.amazonaws.com"
      validates_attachment_content_type :org_pic, :content_type =&gt; /\Aimage\/.*\Z/
  
      def s3_credentials
          {:bucket =&gt; "branchapp", :access_key_id =&gt; "hidden", :secret_access_key =&gt; "hidden"}
      end
  end
  </code></pre>
  
  <p>The upload works great, but the outputted url is like so:</p>
  
  <p><a href="http://branchapp.s3.amazonaws.com/branchapp/orgs/org_pics/000/000/002/original/IMG_0539.JPG?1396413590" rel="nofollow">http://branchapp.s3.amazonaws.com/branchapp/orgs/org_pics/000/000/002/original/IMG_0539.JPG?1396413590</a></p>
  
  <p>I cannot figure out how to remove the /branchapp after the .com. If that is removed the link works without problem. How can I do this?</p>