Final Project pointers Flashcards
What is the difference between giving an anchor tag an href starting with ‘/’ versus one without the slash?
The slash will start the path at the root, whereas not including the ‘/’ will append the path to the current url.
What must you do after making any change to the Gemfile and bundling?
Restart your server.
T/F: Only requests that contain forms require authenticity tokens
F; Any request other than a get request requires an authenticity token.
Why is it more efficient to retrieve matching records from the database each time an event handler is triggered as opposed to simply loading all records once at the start?
Because of the massive amount of data that can be sent out in the second case. Think of a site like Facebook: getting all of the users would be a gigantic and impractical file. Therefore, it is far more efficient to send down only the relevant results from the back end every time a route is triggered.
How can you tell jQuery to look for a selector with more than one class?
Chain the classes together:
“click button.next-question.unanswered”: “revealAnswer”
What must you do to remove a file from a repo after adding it to .gitignore?
Delete it from the repo itself:
$ git rm –cached
Note that you must append a slash for directories.
T/F: when boolean values are sent as strings, Rails is smart enough to know how to parse them.
T
What is a good sign that you have data duplication (avoid it!)
When you can calculate a piece of database data using other pieces of data in the same database