0

I'm using paperclip to upload images in rails, the images are saved well, but then, <%= @user.avatar.url %> returns this:

/system/users/avatars/000/000/001/original/1000203288934_DOCF635653TS102451125.gif%3F1416704056
/system/users/avatars/000/000/001/original/10407722_1175881652452049_8262371134443675175_n.jpg%3F1416705182

instead of just:

/system/users/avatars/000/000/001/original/1000203288934_DOCF635653TS102451125.gif
/system/users/avatars/000/000/001/original/10407722_1175881652452049_8262371134443675175_n.jpg

It happens for every image I upload. Where the hell that %3F-whatever at the end of the url comes from? What I'm doing wrong?

chiwangc
  • 3,566
  • 16
  • 26
  • 32

1 Answers1

0

That is what Paperclip uses for cache-busting. If you want to remove it, just call @user.avatar.url(:original, timestamp: false)

You can also disable this globally by putting the following in the config/initializers/paperclip.rb file.

Paperclip::Attachment.default_options[:use_timestamp] = false

This answer explains why you may want cache-busting in place though.

Community
  • 1
  • 1
Bart Jedrocha
  • 11,450
  • 5
  • 43
  • 53
  • Yeah you're right. It looks to be related to [this](https://github.com/thoughtbot/paperclip/issues/1706). Disable it for the time-being while a fix is being worked out. – Bart Jedrocha Nov 23 '14 at 02:48