Skip to content

Instantly share code, notes, and snippets.

@spohlenz
Created November 16, 2008 22:45
Show Gist options
  • Save spohlenz/25582 to your computer and use it in GitHub Desktop.
Save spohlenz/25582 to your computer and use it in GitHub Desktop.
Old controller pattern
class RecipesController < ApplicationController
...
def new
@recipe = Recipe.new
end
def create
@recipe = Recipe.new(params[:recipe])
if @recipe.save
flash[:notice] = 'Recipe was successfully created.'
redirect_to recipes_path
else
render :action => 'new'
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment