Created
July 17, 2012 20:16
-
-
Save jgarlick/3131749 to your computer and use it in GitHub Desktop.
This file contains 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
class AccountsController < ApplicationController | |
def new | |
@account = Account.new | |
end | |
def create | |
@account = Account.new(params[:account]) | |
if @account.save | |
redirect_to @account, notice: 'Account was successfully created.' | |
else | |
render action: "new" | |
end | |
end | |
def show | |
@account = Account.find(params[:id]) | |
end | |
def edit | |
@account = Account.find(params[:id]) | |
end | |
def update | |
@account = Account.find(params[:id]) | |
if @account.update_attributes(params[:account]) | |
redirect_to @account, notice: 'Account was successfully updated.' | |
else | |
render action: "edit" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment