Created
August 23, 2009 21:57
-
-
Save dewski/173476 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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