Action View Flashcards
Templates:
•The render() ______ expects them in app/view/name
•The render() method expects them in app/view/name
Templates:
•Templates have ____text and ____ code
•Templates have static text and Ruby code
Templates:
•Instance _______ from the ________ available
•Instance variables from the controller available
Templates:
•As are the ___, ______, _____, _______, ______, ________, and _______
•As are the flash, headers, logger, params, request, response, and session
Templates Continued:
•However, debug() can be very helpful
–On ______, _____, and _______
•However, debug() can be very helpful
–On session, params, and response
Templates Continued:
•While we’re on the topic, logger is very useful
–logger.info() puts ______in log/development.log
•While we’re on the topic, logger is very useful
–logger.info() puts messages in log/development.log
Templates Continued:
•The current controller object available as “________”
•The current controller object available as “controller”
Types of Templates:
•______ – for XML
•Builder – for XML
Types of Templates:
•_________ – for JavaScript
•CoffeeScript – for JavaScript
Types of Templates:
•___ – for embedded Ruby
•ERb – for embedded Ruby
Types of Templates:
•_____ – for ‘Sassy’ CSS stylesheets
•SCSS – for ‘Sassy’ CSS stylesheets
Form Helpers
<%= form_tag do %>
Form ________
<% end %>
<%= form_tag do %>
Form contents
<% end %>
First: user_controller.rb:
def edit
@user = ____.find(params[:id])
end
def edit
@user = User.find(params[:id])
end
Then: edit.html.erb
Next: html
<_____ action=“app/save/1”>
<____ name=“user[name]”…>
<____ name=“user[country” …>
<form action=“app/save/1”>
<input name=“user[name]”…>
<input name=“user[country” …>
form>