Action View Flashcards

1
Q

Templates:
•The render() ______ expects them in app/view/name

A

•The render() method expects them in app/view/name

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

Templates:

•Templates have ____text and ____ code

A

•Templates have static text and Ruby code

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

Templates:

•Instance _______ from the ________ available

A

•Instance variables from the controller available

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

Templates:

•As are the ___, ______, _____, _______, ______, ________, and _______

A

•As are the flash, headers, logger, params, request, response, and session

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

Templates Continued:

•However, debug() can be very helpful

–On ______, _____, and _______

A

•However, debug() can be very helpful

–On session, params, and response

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

Templates Continued:

•While we’re on the topic, logger is very useful

–logger.info() puts ______in log/development.log

A

•While we’re on the topic, logger is very useful

–logger.info() puts messages in log/development.log

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

Templates Continued:

•The current controller object available as “________”

A

•The current controller object available as “controller

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

Types of Templates:
•______ – for XML

A

Builder – for XML

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

Types of Templates:

•_________ – for JavaScript

A

CoffeeScript – for JavaScript

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

Types of Templates:
•___ – for embedded Ruby

A

ERb – for embedded Ruby

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

Types of Templates:

•_____ – for ‘Sassy’ CSS stylesheets

A

SCSS – for ‘Sassy’ CSS stylesheets

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

Form Helpers
<%= form_tag do %>

Form ________

<% end %>

A

<%= form_tag do %>

Form contents

<% end %>

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

First: user_controller.rb:

def edit

@user = ____.find(params[:id])

end

A

def edit

@user = User.find(params[:id])

end

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

Then: edit.html.erb

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

Next: html

<_____ action=“app/save/1”>

<____ name=“user[name]”…>

<____ name=“user[country” …>

A

<form action=“app/save/1”>

<input name=“user[name]”…>

<input name=“user[country” …>

form>

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

Returns: Params Hash

@params = {

id: 1
user: {
name: …
country: …

}

}

A

@params = {

id: 1
user: {
name: …
country: …

}

}

17
Q

Back in Rails

def save

use params

end

A

def save

use params

end

18
Q
A