Displaying 1 result from an estimated 1 matches for "add_image_by_size".
2006 Feb 17
1
validate() with has_many association
...re was a problem updating the record
@heading = "Painting Editor"
render :action => ''edit'', :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...