Skip to content

Instantly share code, notes, and snippets.

@dewski
Created August 23, 2009 21:57
Show Gist options
  • Select an option

  • Save dewski/173476 to your computer and use it in GitHub Desktop.

Select an option

Save dewski/173476 to your computer and use it in GitHub Desktop.
def pictures
@picture = Picture.new(params[:picture])
@picture.data_content_type = MIME::Types.type_for(params[:Filename]).to_s
@picture.recipe_id = params[:recipe_id]
respond_to do |format|
if @picture.save
flash[:notice] = "Saved the picture."
format.html { redirect_to recipe_path(params[:recipe_id]) }
format.js
else
format.html { redirect_to recipe_path(params[:recipe_id]) }
format.js
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment