Project

General

Profile

« Previous | Next » 

Revision 5c004100

Added by Marc Dequènes almost 15 years ago

  • ID 5c0041007ec2c0cbf098919afed233d2d748280b

[evol] ArtworkStepImage: added helper method to get a thumbnail by size

View differences:

app/helpers/application_helper.rb
image_padding = params.has_key?(:image_padding) ? params[:image_padding] : 5
frame_margin = params.has_key?(:frame_margin) ? params[:frame_margin] : 3
thumb = image.artwork_step_thumbnails.find_by_thumbnail(size.to_s)
thumb = image.thumbnail(size)
frame_width = thumb.width + image_padding * 2
style = "text-align: center; padding: 0px; width: #{frame_width}px;"
#style += " border: 1px solid red;"
app/models/artwork_step_image.rb
public :after_process_attachment
attr_accessor :saved_attachment
def thumbnail(size)
self.artwork_step_thumbnails.find_by_thumbnail(size.to_s)
end
end

Also available in: Unified diff