Skip to content

Instantly share code, notes, and snippets.

@braidn
Created March 8, 2013 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braidn/5114104 to your computer and use it in GitHub Desktop.
Save braidn/5114104 to your computer and use it in GitHub Desktop.
Controller Compare
class CompletelyFuckingCustomController < ApplicationController
def index
@completelyFuckingAwesome = CompletelyFuckingCustom.all
end
def show
@completelyFuckingAwesome = CompletelyFuckingCustom.find(params[:id])
end
def new
@completelyFuckingAwesome = CompletelyFuckingCustom.new
end
def edit
@completelyFuckingAwesome = CompletelyFuckingCustom.find(params[:id])
end
def create
@completelyFuckingAwesome = CompletelyFuckingCustom.new(params[:completely_fucking_custom])
if @completelyFuckingAwesome.save?
redirect_to @completelyFuckingAwesome, notice: 'YOU DID IT'
else
render 'new'
end
end
def update
@completelyFuckingAwesome = CompletelyFuckingCustom.find(params[:id])
if @completelyFuckingAwesome.update_attributes(params[:completely_fucking_custom])
redirect_to @completelyFuckingAwesome, notice: 'YOU DID IT... again'
else
render 'edit'
end
end
def destroy
@completelyFuckingAwesome = find(params[:id])
@completelyFuckingAwesome.destroy
redirect_to completely_fucking_customs_url
end
end
class NotFuckingCustomsController < ApplicationController
def index
@not_fucking_customs = NotFuckingCustom.all
end
def show
@not_fucking_custom = NotFuckingCustom.find(params[:id])
end
def new
@not_fucking_custom = NotFuckingCustom.new
end
def edit
@not_fucking_custom = NotFuckingCustom.find(params[:id])
end
def create
@not_fucking_custom = NotFuckingCustom.new(params[:not_fucking_custom])
if @not_fucking_custom.save
redirect_to @not_fucking_custom, notice: 'Not fucking custom was successfully created.'
else
render action: "new"
end
end
def update
@not_fucking_custom = NotFuckingCustom.find(params[:id])
if @not_fucking_custom.update_attributes(params[:not_fucking_custom])
redirect_to @not_fucking_custom, notice: 'Not fucking custom was successfully updated.'
else
render action: "edit"
end
end
def destroy
@not_fucking_custom = NotFuckingCustom.find(params[:id])
@not_fucking_custom.destroy
redirect_to not_fucking_customs_url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment