(15 points) Rails is based on three philosophical principles. What
are they? (Just name, don't describe.) Convention over configuration
Don't Repeat Yourself (DRY)
Agile development
(15 points) Rails uses three environments. What
are they? (Just name, don't describe.)
development, test, production
(10 points) A Rails controller method must end in one of two ways.
What are they? Passing control to another controller method, OR
Passing control to a view template
(10 points) An .rhtml file is a Ruby HTML file. Tell how
to include...
...executable statements that do computations but do not produce
output: Enclose statements in <% %>
...expressions whose value is to be inserted into the.rhtml page: Enclose statements in <%= %>
(20 points) Briefly define the following terms:
layout A template file for an HTML (.rhtml) page
partial A template file for just a part of an HTML (.rhtml) page
fixture A set of data for a test
migration A way to write the database in Ruby, avoiding SQL
(5 points) Briefly, what does Ruby's h method do?
Replaces &, ", <, and > with &, ", <,
and >, respectively.
(5 points) What is the one thing that Rails cannot do when creating
a web application? Create the initial SQL database.
(10 points) Name the two kinds of scripting command used by Rails. generate and rake
(5 points) A validation checks the legality of something.
What is that something? a requested database entry or update
(5 points) What is YAML used to describe? Ruby objects
(4 points partial credit if the answer is: fixtures)