- inventor of structured programming
- came up with “for, while, until, case”
- computer science is not about machines and equipment management
If you use more of a bad tool, it won’t fix it.
About the use of language; it is impossible to sharpen a pencil with a blunt axe. It is equally vain to try to do it with ten blunt axes instead.
Programming is just about communicating clearly.
- Once it is teachable it is concrete.
1 2 3 4 5
??have to delete rm-rf public/index.html
1 2 3 4 5 6 7 8
Private and public methods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
private, public, and protected all create keyword scope -> created limited, predicted interfaces
if a method is private it can only be called on an implicit receiver- can’t call call on an explicit receiver
protected -> can only be called on self.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
In the migration
- def change for when the reverse can be assumed
def up and down for things like renaming columns -> because rails wouldn’t be able to infer what the reverse would be.
t.timestamps - is a created at and updated at
when you login, you are creating a session between you and the website. when you signup you are creating a user on their system– that lives in their DB
Mass assignment => when you assign initialization properties during assingment.
- define and edit schema
- insert rows /update
Routes maps URLs to actions in the controller
- contains the business logic
- the actual interface
-> In sinatra the routes are built into controllers.
1 2 3 4
In your controller helper…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Customizing the forms and encapsulate in the controller helpers…
Test::Unit to RSpec
change out the libraries add rspec to the gem file rip out test folder
rails g install rspec
“when i generated the scaffold, it generated the specs for me…”
Posting Info to an object
- instantiate an instance
- collect the form data
- and you populate the instance attribute with the proper data
If I want to use form_for I need an active record instance.