Skip to content

Instantly share code, notes, and snippets.

@jasonblanchard
Created January 17, 2014 22:26
Show Gist options
  • Select an option

  • Save jasonblanchard/8482811 to your computer and use it in GitHub Desktop.

Select an option

Save jasonblanchard/8482811 to your computer and use it in GitHub Desktop.
def new
@garment = Garment.new(params[:id])
@garment.save
if ImageSaver.new(@garment).save_garment_with_image
respond_to do |format|
format.html
end
end
end
end
class ImageSaverService
def inititalize(garment)
@garment = garment
end
def save_garment_with_image
if url_has_changed
do_the_savey_thing
@garment.save
else
do_the_other_thing
end
@garment
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment