Skip to content

Instantly share code, notes, and snippets.

@charliegerard
Last active August 29, 2015 13:57
Show Gist options
  • Save charliegerard/9731145 to your computer and use it in GitHub Desktop.
Save charliegerard/9731145 to your computer and use it in GitHub Desktop.

#Day 21

##Branching

git branch shows the branches your repo already has git checkout -b login -> To go in the branch git branch

git checkout master goes back to main repo git checkout login --> goes back to branch

go to final repo in terminal and "git merge login" will merge the branch in the main repo git push origin master.

always do git status before changing branches. change branch when chnges committed

Adding an admin to our site: rails generate migration add_admin_to_users --> add code to database file: add_column :users, :admin, :boolean, :default => false

u.admin = true u.save to make a user admin

in seeds file: u3.admin = true u3.save

def edit @user = @current_user end --> so you can only edit your own details

build session controller with new, create, delete

<%== intellinav %> --> double == to tell the browser to interpret the content as raw.

Pushing on Heroku:

changing to master branch and mergin branches.

In console: "heroku login" Enter username and password

heroku create --addons heroku postgresql heroku pg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment