Chapter 2 Flashcards
when you create new app, what git steps do you need to take:
git init
git add -A
git commit -am “initialize repository”
connect new app to github:
create new repository on github manually.
then:
git remote add origin https://github.com/Saweel/toy_app.git
how to remove origin from git repo and set another one
git remote set-url origin newURL
data model
representation of the structures needed by our application. conceptual model of how data items relate to each other
data model for toy_app
microblog with users and short microposts.
data model for users:
unique integer identifier id, name, email
data model for microposts:
id and a content field for the text. also a user_id to associate each micropost with a particular user
User resource:
think of users as objects that can be created, read, updated, deleted through the web via the HTTP protocol (created using scaffoldin)
generate user with name and email using scaffolding
rails generate scaffold User name:string email:string
update the database in rails after creating a new user data model
bundle exec rake db:mirate
what is “make”?
unix, make utility is used to build executable programs from source code.
Rake:
rake is rubys make, a make-like language written in ruby. uses rake for little administrative tasks necessary developing database-backed web application.
bundle exec rake -T db
list of database tasks
bundle exec rake -T
all the rake tasks available
URL/users
index, page to list all users