Displaying 1 result from an estimated 1 matches for "save_photo".
2011 Aug 27
5
image override*
...ml { redirect_to(photos_url) }
format.xml { head :ok }
end
end
end
********************************
class Photo < ActiveRecord::Base
# Root directory of the photo public/photos
PHOTO_STORE = File.join RAILS_ROOT, ''public'', ''images''
# Invoke save_photo method when save is completed
after_save :save_photo
def load_photo_file=(data)
# Record the filename
self.filename = data.original_filename
# Store the data for later use
@photo_data = data
end
name = File.join PHOTO_STORE, self.filename
File.open(n...