1. validate
2. ActionPack
3. flight_id
4. ruby make
validate
1. singular
2. @ads = Ad.find(:all)
3. validate
4. rake db:migrate
@ads = Ad.find(:all)
1. a responder object
2. validate
3. flight_id
4. an object
an object
1. 1. all important data is a resource, 2. every resource has a proper name (URL), 3. you can perform a standard set of operations on resources (usually CRUD), 4. client and server talk statelessly
2. model names are singular, controller (and table) names are plural
3. a script that alters the structure of the underlying database
4. no. arrays just keep references to objects stored in memory.
1. all important data is a resource, 2. every resource has a proper name (URL), 3. you can perform a standard set of operations on resources (usually CRUD), 4. client and server talk statelessly
1. An array uses indices and a hash uses “keys”
2. puts (pronounced “put-ess”)
3. Red refers to writing a failing test
4. When the order matters, use an array.
When the order matters, use an array.
1. An array uses indices and a hash uses “keys”
2. It’s a test that simulates a browser accessing our application.
3. Red, Green, Refactor,Red refers to writing a failing test,Green refers to writing a passing test Once we have a passing test we are free to refactor the code.
4. This maps requests for the URL /pages/home to the home action in the Pages controller.
Red, Green, Refactor,Red refers to writing a failing test,Green refers to writing a passing test Once we have a passing test we are free to refactor the code.
1. This is not a standard rails directory, but a directory installed by RSpec in which all test files are kept.
2. The @ indicates that this is an “instance variable”. An instance variable defined in the action (or function) of a controller is automatically available in the view of that same name.
3. It’s a test that simulates a browser accessing our application.
4. Ruby complains if we try to evaluate an undefined local variable, but issues no such complaint for an instance variable; instead, instance variables are nil if not defined
Ruby complains if we try to evaluate an undefined local variable, but issues no such complaint for an instance variable; instead, instance variables are nil if not defined
1. The “erb” stands for “Embedded RuBy”. .erb files look like about.html.erb and live in the “views” directory.They are just html files with embedded ruby in them.
2. The @ indicates that this is an “instance variable”. An instance variable defined in the action (or function) of a controller is automatically available in the view of that same name.
3. puts (pronounced “put-ess”)
4. It’s a test that simulates a browser accessing our application.
The “erb” stands for “Embedded RuBy”. .erb files look like about.html.erb and live in the “views” directory.They are just html files with embedded ruby in them.
1. An array uses indices and a hash uses “keys”
2. It’s easier to describe what objects do, which is respond to messages. An object like a string, for example, can respond to the message length, which returns the number of characters in the string
3. This maps requests for the URL /pages/home to the home action in the Pages controller.
4. It’s a test that simulates a browser accessing our application.
It’s easier to describe what objects do, which is respond to messages. An object like a string, for example, can respond to the message length, which returns the number of characters in the string
1. An array uses indices and a hash uses “keys”
2. Classes are simply a convenient way to organize functions (also called methods). In pages_controller.rb, PagesController is a Class which holds a “home” action.
3. A controller is a container for a group of (possibly dynamic) web pages.
4. This maps requests for the URL /pages/home to the home action in the Pages controller.
Classes are simply a convenient way to organize functions (also called methods). In pages_controller.rb, PagesController is a Class which holds a “home” action.