Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:48:09+00:00 2026-06-11T00:48:09+00:00

Paperclip is generating wrong URLs in Heroku. I have an Audio model which has

  • 0

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

http://s3.amazonaws.com/MyApp/audios/mp3s//original/96a9ae89302fdf8462ee05eb829f2e17578b144e20120908-2-11f61zr.mp3?1347135050

instead of

http://s3.amazonaws.com/MyApp/audios/mp3s/000/000/004/original/96a9ae89302fdf8462ee05eb829f2e17578b144e20120908-2-11f61zr.mp3?1347135050
(which works)

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:48:10+00:00Added an answer on June 11, 2026 at 12:48 am

    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?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I am new to paperclip) I have this model hierarchy: base model: class QuestDescription
It looks like Paperclip doesn't honor the ActiveRecord dirty model. How do I detect
I have a form_tag on a Stream model which accepts user input as show
Paperclip gem 3.0.4 When I use flat Paperclip definition in Model (UserDetail has an
I have installed paperclip and imagemagick,and implemented the code to my model and view
Paperclip image urls have ?395762034287346 after them.. does that affect it in anyway? I
Use paperclip for my images. Models: class Country < ActiveRecord::Base has_many :regions has_many :assets,
I have installed paperclip on my rails app (deployed on heroku). On my localhost
I'm using Paperclip to save pictures in my Rails application: User model: class User
The Paperclip plugin for Rails has a resize option that keeps the image in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.