I installed the gem paperclip and set it up. I put this piece of code in one of my controllers
@pictures = Picture.near([latitude, longitude], 6.8) #im also using geocoder
@picturethumbs = @pictures
@picturethumbs.each do |thumb|
thumb.photo = thumb.photo(:thumb)
end
when i do this in my view
<% @picturethumbs.each do |picture| %>
<p> <%= link_to image_tag(picture.photo), picture_path(picture) %>
</p><% end %>
i get regular sized images.
If i dont resize in my controller, but i do picture.photo(:thumb) in the view i get the right thumbs. Could you help me resize the image independently of modifying it in the view. Maybe another model which corresponds to pictures but contains automatically thumbs (not resizing in view)
Can you please post more details on how your Model is set up, which uses paperclip?
You will need this in your model :
and then in your view:
Check this RailsCast:
http://railscasts.com/episodes/134-paperclip
http://asciicasts.com/episodes/134-paperclip