Final Project pointers Flashcards

1
Q

What is the difference between giving an anchor tag an href starting with ‘/’ versus one without the slash?

A

The slash will start the path at the root, whereas not including the ‘/’ will append the path to the current url.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What must you do after making any change to the Gemfile and bundling?

A

Restart your server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T/F: Only requests that contain forms require authenticity tokens

A

F; Any request other than a get request requires an authenticity token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you tell jQuery to look for a selector with more than one class?

A

Chain the classes together:

“click button.next-question.unanswered”: “revealAnswer”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What must you do to remove a file from a repo after adding it to .gitignore?

A

Delete it from the repo itself:

$ git rm –cached

Note that you must append a slash for directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

T/F: when boolean values are sent as strings, Rails is smart enough to know how to parse them.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a good sign that you have data duplication (avoid it!)

A

When you can calculate a piece of database data using other pieces of data in the same database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly