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:
class Org < ActiveRecord::Base
has_many :event
has_many :solookup
belongs_to :student
has_attached_file :org_pic, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/assets/clubhouse.jpg", :storage => :s3, :s3_credentials => Proc.new{|a| a.instance.s3_credentials}, :s3_host_name => "branchapp.s3.amazonaws.com"
validates_attachment_content_type :org_pic, :content_type => /\Aimage\/.*\Z/
def s3_credentials
{:bucket => "branchapp", :access_key_id => "hidden", :secret_access_key => "hidden"}
end
end
The upload works great, but the outputted url is like so:
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?