In has_attached_file
you need to override the url
option. By default the url uses ":s3_path_url"
which puts the bucket in the url like you see. You need to use ":s3_domain_url"
instead.
Add:
:url => ":s3_domain_url"
to your has_attached_file
options.
Note: ":s3_domain_url"
should prefix the host with the bucket name so you might need to remove branchapp
from your s3_host_name
option. (:s3_host_name => "s3.amazonaws.com"
)