What is the original path of image that uploaded by paperclip.
has_attached_file :attachment,
:url => ":rails_root/public/photos/images/:id/:style/:basename.:extension",
:default => ":rails_root/public/images/no-image-available.png",
:styles => style_options,
:default_style => :gallery
and style_options are
style_options = { :thumbnail => {:geometry => '100x100'},
:profile_gallery => {:geometry => '184x247'}
}
In my public folder create 3 folder while one image upload 1. thumbnail, 2. profile_gallary 3. original.
In my view file I call
<%= photo.thumbnail_url %>
My Question is I want to use original path that upload image. I don't want to use thumnail for any particular url. How can I use original path.
Thanks for Advance
<%= photo.attachment.url(:original) %>
That will give you the path to the original file, you can also get the other styles if needed:
<%= photo.attachment.url(:thumbnail) %>
<%= photo.attachment.url(:profile_gallery) %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With