search for: get_image_by_size

Displaying 1 result from an estimated 1 matches for "get_image_by_size".

2006 Feb 17
1
validate() with has_many association
...it'', :id => @params[:id] end end painting model has_many :images def thumbnail=(uploaded_image) # form has a file upload field named painting[:thumbnail] add_image_by_size(uploaded_image, THUMBNAIL) end private def add_image_by_size(file, image_size) if existing_image = get_image_by_size(image_size) then if existing_image.uploaded_file?(file, image_size) existing_image.save else #handle the fact that it didn''t save end else # a new image is being associated with the painting image = Image.new image.uploaded_file(file...