Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:51
Show Gist options
  • Save craigw/150845 to your computer and use it in GitHub Desktop.
Save craigw/150845 to your computer and use it in GitHub Desktop.
class SandwichesController < ApplicationController
def new
end
def create
@sandwich = Sandwich.create(params[:sandwich])
redirect_to :action => 'show', :id => @sandwich
end
def show
# Notice that this variable starts with an @ to match the view.
@sandwich = Sandwich.find(params[:id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment