how to implement thumbnail for image in rails.
step 1:-
go to uploader inside views where you have written image uploader code for uploading image. uncomment this section
#Create different versions of your uploaded files:
version :thumb do
process :resize_to_fit => [50, 50]
end
And after uncommenting this implement include minimagick for your image uploader.
step 2:-
include CarrierWave::MiniMagick
now you have to define thumbnail object in the views where you are rendering the image.
step :-3
<%= image_tag (category.category_image.thumb) if category.category_image? %>
0 Comment(s)