CNAME example

469 views
Skip to first unread message

mpokress

unread,
Apr 29, 2009, 12:51:00 PM4/29/09
to Paperclip Plugin
Hi-

I am trying to set up Paperclip to generate a CNAME based URL for the
images. I seem to be missing something when reading the comment in
storage.rb. Here is what I have done:

has_attached_file :attachment1,
:styles => {:thumb => ["150x150>", :jpg],
:medium => ["500x500>", :jpg],
:square => ["150x150#", :jpg]},
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/aws.yml",
:url => :s3_alias_url,
:s3_host_alias => 'foo.company.com',
:path => ":attachment/:id/:style/:basename.:extension"

This is with the latest from github.

Thanks,

Matt

Andrei Erdoss

unread,
Jun 3, 2009, 5:28:55 AM6/3/09
to Paperclip Plugin
Hello Matt,

Were you able to figure this out? I am having the same problem. The
url shows the path url not the cname format.

Thanks,

Andrei Erdoss

unread,
Jun 3, 2009, 5:43:24 AM6/3/09
to Paperclip Plugin
Btw, does anybody have a working copy of the settings for paperclip, S3 with a CNAME? I spent the entire morning browsing Google and trying different options without much luck.

Thanks for any help in advance,

Andrei
--
Andrei Erdoss

mpokress

unread,
Jun 3, 2009, 4:45:35 PM6/3/09
to Paperclip Plugin
Andrei-

I did not have any luck with this and ended up adding a method to my
model that parses the URL and returns what I want (with CNAME
substitution). I'm not happy about it, but I had to move on to other
problems.

Matt

Jonathan Yurek

unread,
Jun 4, 2009, 2:31:42 PM6/4/09
to papercli...@googlegroups.com
The url option must be :url => ":s3_alias_url", as it is an
interpolation of a variable, not a symbol on its own. I agree that
this isn't the most straightforward implementation of this and I would
like to change it at some point.
--
Jonathan Yurek, Founder and CTO
thoughtbot, inc.
organic brains. digital solutions.

617.482.1300 x114
http://www.thoughtbot.com/

Andrei Erdoss

unread,
Jun 5, 2009, 12:47:18 PM6/5/09
to papercli...@googlegroups.com
That worked. Thanks a lot.
--
Andrei Erdoss
Reply all
Reply to author
Forward
0 new messages