Paperclip is generating wrong URLs in Heroku.
I have an Audio model which has a mp3 field as follows:
class Audio < ActiveRecord::Base
has_attached_file :mp3,
:storage => :s3,
:s3_credentials => S3_CREDENTIALS,
:bucket => S3_CREDENTIALS[:bucket],
:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
:url => "/system/:attachment/:id/:style/:filename"
I am calling audio.mp3.url from a controller, and it returns
instead of
Why is it missing the '000/000/004' part of the route?
The same model is generating the right URL when used in a view.
Any help?
I am using paperclip 3.2.0 and Rails 3.1.8. Any help?
It looks like the '000/000/004' part of the route is the new to paperclip as of 3.0 feature of :id_partition
. Try changing :id
to :id_partition
. Maybe you changed url in your code after already having uploaded something?