Skip to content

Instantly share code, notes, and snippets.

@nakaearth
Last active December 14, 2015 13:58
Show Gist options
  • Save nakaearth/5097145 to your computer and use it in GitHub Desktop.
Save nakaearth/5097145 to your computer and use it in GitHub Desktop.
Stamp.rbのPaperclipのサンプル抜粋
class Stamp < ActiveRecord::Base
####途中省略####
if Rails.env.production?
S3_CREDENTIALS={access_key_id:ENV['S3_ACCESS_KEY_ID'], secret_access_key:ENV['S3_SECRET_KEY'], bucket:"hoge-bucket"}
end
if Rails.env.production?
has_attached_file :stamp, storage: :s3, s3_credentials: S3_CREDENTIALS,
styles: {stamps_s:"100x100&gt;",stamps:"350x350&gt;"},url:":s3_domain_url",path:"stamps/:style/:filename"
else
has_attached_file :stamp, url: "/:style/:img_dir_num/:filename" , styles: {stamps_s:"100x100&gt;",stamps:"350x350&gt;"}
end
end
@hito-asa
Copy link

hito-asa commented Apr 2, 2013

スペーシング的なとこだけ直しました
https://gist.github.com/hito-asa/5290921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment