The textbook will help fill in the gaps in your knowledge.
Exam Format
Exam questions will be of the following possible formats:
Short Answer and Problems; Short Essay; Multiple Choice.
Problems might ask you to
Predict the output of Ruby code.
Modify rails source code according to specs.
Make corrections in Rails source code.
Here are some sample short essay questions:
Describe some of the common mistakes that you encountered in this
class when learning to create Rails projects.
Explain what DRY means and how it influences the organization
of Rails projects.
Explain what some of the ActiveRecord methods are and how they are
used to obtain and display information from databases.
Explain how the Rails FormHelper methods are used to construct
forms that can be submitted back to the controller on the server.
Explain what a Ruby array is and why arrays are useful in Rails programming.
What are some useful methods of the Array class?
Definitions
Ruby, Rails, DRY, controller,
view, action, layout, route, HTML vs. XHTML, CSS, scaffold, CRUD, helper
function,
Rails datatypes, Rails helper methods (stylesheet_link_tag, image_tag,
link_to), IRB, IRB delimiters (<%=, <%, %>),
Ruby datatypes, REST, HTTP (GET, POST, PUT,
HEAD, DELETE), 6 ways to run Ruby(IRB, batch Ruby script, ERB,
Rails console, load script from Rails console, seed file),
Ruby classes (FixNum, Float,
Time, String, Array; see the
UML Examples Page for methods.
instance variable, method,
Ruby object methods common to many objects (new, to_s, to_i,
to_f, class, methods), Ruby datatypes (integer, floating point,
string, boolean), Ruby operators (=, +, -, *, /, %, ==, <, >, <=, >=, !=,),
Ruby control structures (if..else, while), Ruby builtin
methods (print, puts, random, STDIN.gets), variable interpolation (for example
"My name is #{name}.\n", FormTagHelper methods (form_tag,
text_field_tag, select_tag), FormHelper methods (form_for, text_field,
text_area, select, radio_button, check_box, submit) model creation
software, scaffold creation software, rake db:migrate, rake db:seed,
seed file, ActiveRecord methods (new, find(id),
find with conditions, all, save, delete(id), delete_all), fat model,
validation, one-many relationship,
Be Able To
Explain how to do each of the following:
create a Rails project, create a Rails controller with some views, how to
add a new view to a controller after the controller has already been created,
create a Rails application using scaffold software, create a Rails model
without using a scaffold.
Modify the HTML and CSS files of a Rails project.
Set the background color for the body, h1, h2, h3, or a
Set the text color for the body, h1, h2, h3, or a
Set the font family for the body, h1, h2, h3, or a
Set the font size for the body, h1, h2, h3, or a.
Set the font weight (bold or normal) for the body, h1, h2, or h3.
Set the width and height of an image.
Modify Rails source code according to specifications.
Use the Rails helper functions stylesheet_link, image_link, link_to.
Modify a Ruby command line application to display output from the
controller on a view using ERB.
Write or modify a Rails project that displays an image on a form
according to calculations in the controller (like Project 4).
Use these Rails ActiveRecord methods to extract or modify the
data in the database.
all
count
delete
delete_all
find
save
For example here are some examples of dynamic finder methods
for the Student class:
# Find student with id == 4.
@s = Student.find(4)
# Find student with first_name == "Alice".
@s = Student.find_by_name("Alice")
# Get array of all students with gender == "F".
@a = Student.find_all_by_gender("F")
Explain what an array is and how it is used in Rails.
Test methods of the Array class.
Explain what a Range object is and how it is used in Rails.
Test methods of the Range class.
Know the following about
FormTagHelper and FormHelper controls:
The difference between FormTagHelper and FormHelper controls.
Which FormTagHelper or FormHelper controls are most appropriate
to use in a given situation.
How to use the FormTagHelper methods form_tag, text_field_tag, and
submit_tag to manage data.
How to use the FormHelper methods form_for, text_field, select,
radio_button, and check_box to manage data.
Write views that use the ActiveRecord methods to store or access data.
Manipulate a database by issuing Ruby statements at
the Rails console window or running the seeds.db file with
rake db:seed.
Load records into a database by using a seed file.
Set up a one-many relationship between two models.
Set up validation for controls on a form.
Given source code for a Rails project, find the errors.