Skip to content Skip to sidebar Skip to footer

Getting Url From Paperclip (ror)

for some reason, I try to get the url of an image in various ways. I am using paperclip. None of them work. I've tried img.image.url img.image.url(:thumbnails) img.image.url(:displ

Solution 1:

Alas, it was a matter of putting quotes around the url... thanks for your help...

img.src = "<%= @other_images[4].image.url %>";

Solution 2:

If the image is correctly displayed when you put image_tag before it, then your call is returning the exact URL (since it's good enough for the browser to download the image). I'm also using paperclip in my app and I'm getting the URLs in exactly the same way you gave.

I suggest you look for an error in you JS code, or wherever you're trying to preload the images.

Post a Comment for "Getting Url From Paperclip (ror)"