Chapter 5 Flashcards

You may prefer our related Brainscape-certified flashcards:
0
Q

What should a mockup/wireframe include?

A

User interface, links, buttons, etc

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

What is a mockup/wireframe, and why is it important?

A

A rough sketch of what the application will eventually look like; it allows you to work towards a goal.

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

To support older browsers which can’t parse HTML5 elements, what JavaScript script should be added, and where?

A

HTML5shim should be added in the head

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

What is the difference between a class an an ID?

A

Classes can be used multiple times on a page, ID’s can only be used once.

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

T/F: only one class may be assigned to a tag.

A

F; you can assign multiple classes by separating them with a space

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

What are header, nav, and section tags for?

A

They are used like div tags, except that they also describe the location of the element on the page.

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

What are the three arguments to the link_to function, and what purpose does the function serve?

A

It creates a link on the page.

The first argument is the link text, next is the url, and last is an options hash for CSS purposes

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

When using the image_tag helper, where will Rails look for the image?

A

app/assets/images/

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

What are the arguments to image_tag?

A

The path of the image and an options hash, used to set attributes

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

Why does rails place all assets in the same directory when operating on a server?

A

It allows them to be served faster.

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

What is Bootstrap?

A

A framework from Twitter which allows for design and UI elements in HTML5

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

What is a .css.scss file?

A

A Sass-CSS file

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

How can we include bootstrap?

A

After getting the gem, add the following lines to a sass file in the asset pipeline:

@import “bootstrap-sprockets”;
@import “bootstrap”;

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

What is a good way to test out what a CSS rule does?

A

Comment it out and see what changes

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

Why is the CSS of a style sheet in the app/assets/stylesheets/ directory universal?

A

It is applied to all pages, and if no class or ID is specified then all tags as well. The higher level of the tag (I.e. html is the highest tag) then the more tags that will be affected.

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

What does the ‘render’ function do?

A

Inserts the evaluation of a file into the view.

16
Q

What is the naming convention or partials?

A

Add an underscore (_) to the beginning of the file name

17
Q

What is a partial?

A

A way, in Rails, to package up assets in one place.

18
Q

Describe the asset directories of the asset pipeline.

A

App, lib, and vendor directories each have an assets directory, which in turn has a subdirectory for images, javascripts, and stylesheets

19
Q

What are manifest files of the asset pipeline?

A

Files to tell Rails how to combine javascripts and CSS into single files

20
Q

What is the preprocessor engine of the asset pipeline?

A

Processes files in a manner depending on their extension, for delivery to browser. Files with multiple extension are evaluated right to left, with the rightmost (last) extension determining the first processor.

21
Q

Why is the asset pipeline efficient?

A

It allows assets to be logically split into different files, but Rails optimizes them and combined them into a single ole for speedy delivery to a browser

22
Q

What is the syntax for nesting pseudo-classes in sass?

A

&:pseudoclassname{}

23
Q

What is the syntax for defining a variable in sass?

A

$varname: value;

24
Q

Say we want to add a page, what are the steps to take?

A

Add a route, add a controller action, and add an erb view

25
Q

How can we defined a named route?

A

get ‘routename’ => ‘controller#action’

26
Q

T/F: named routes will not work in other files; they are only for the server.

A

F; once a route has been named it can be used anywhere else

27
Q

What routes does the following named route define:

get ‘help’ => ‘static_pages#help’

A

help_path, which is ‘/help’

help_url, which is the full, unabbreviated URL

28
Q

What is an integration test, and how is one defined?

A

It is a test of our application’s behavior.

It can be generated with:

$rails generate integration_test testname