"/:style/:fil...">

Clip Amazon S3 with Heroku

has_attached_file :image, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/:style/:filename"

I'm not sure what it is :path => "/:style/:filename".

I also want to include a style for this attached image, is that the way :? the style I want is this::styles => { :medium => "275x275>", :thumb => "175x155>" }

Basically, what happens here is what I'm setting up for heroku, and I need to use S3, which seems simple, just not used for this conditional agreement material.

Also, I just signed up for an S3 account ... but herokunotified that it was free or something like that. What is the reason for this?

+3
source share
2 answers

"" S3, . , :

 has_attached_file :image, 
    :styles => { :medium => "275x275>", :thumb => "175x155>" },
    :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/amazon_s3.yml",
    :path => "user/:attachment/:style/:id.:extension"

URL- :

http://s3.amazonaws.com/bucket/user/image/thumb/347853856.jpg

, S3 (Heroku , / , ). Heroku , .

+9

, Rails 3.1 Rails.root, RAILS_ROOT

+4

Source: https://habr.com/ru/post/1758622/


All Articles