To Exam Info
IT 232 -- Review Guide for Early Final
Bring to Midterm
Study
- Course Notes, especially Review Questions at the beginning of each
lecture.
- D2L Quizzes
- Midterm Review Questions
- Projects 1 to 4
- You don't have to answer the midterm questions perfectly to obtain a good score.
Exam Questions Format
- Exam questions will be of the following possible formats:
short answer; short essay; predict output of a Rails project, fix the errors in
the Rails project source code, short essay.
- All questions will be written with a pen or pencil--computers are not
allowed for the final exam.
Definitions
- HTML5, DRY, CoC, model, controller, view, action, layout, route, ERB, CSS, scaffold, CRUD,
IRB, IRB delimiters (<%=, <%, %>),
Ruby datatypes, REST, 7 ways to run Ruby code, instance variable, method,
hex color code, model,
validation, one-many relationship, many-to-many relationship, one-way encryption
(digest, cryptographic hash), migrations, regular expressions, self referential
join, jQuery, CoffeeScript, AJAX, partial.
HTML Tags
html head title style link script meta body img p div span
h1 h2 h3 h4 h5 h6 h7 br ol ul li table tr td th a img form
input textarea select button strong em pre sub sup
HTML Special Characters
< > &
CSS Tags
font color background text-indent text-align vertical-align
text-decoration border margin padding width height
border-radius position left top
Ruby Control Structures
if elsif unless while until end
Ruby Instance Methods
C means class method.
- Standalone: rand
- Object: to_s to_i to_f
to_a class methods sort
- Fixnum: abs
- Float: abs floor ceil
- String: new(C) downcase index length
split upcase
- Time: new(C) day dst? hour min mon
now sec wday year
- Array:
new length empty? delete_at each collect
sort
- Range: new (C) start end
includes?
Ruby Operators
+ - * / % = += -= *= /= << [ ] .
< > <= >= == != <=> && || ^ ! ..
Rails Command Line Statements
new generate controller scaffold migration
rake db:migrate rake db:seed
Rails Model Datatypes
string integer float decimal boolean text date datetime
Rails Helper Methods
- ActiveRecord: all count delete
delete_all find first last new save
- FormTagHelper: form_tag
text_field_tag text_area_tag submit_tag radio_button_tag
check_box_tag file_field_tag
- FormHelper: form_for f.text_area
f.submit f.radio_button f.check_box f.file_field
- URLHelper: link_to
link_to_unless_current
- AssetTagHelper: image_tag stylesheet_link_tag
- PathHelpers: These methods are dynamically generated, for example:
students_path new_students_path
student_path(@student).
Rails validates Options
:presence_of :numericality_of
ActiveRecord Associations Class Methods
has_many belongs_to has_and_belongs_to_many
HTTP Verbs
HEAD GET POST PUT PATCH DELETE
Some jQuery Selectors
$("p") $("p:first") $("#btn") #(".field")
Some jQuery Events
ready click mouseenter mouseleave focus blur
Be Able To
- Explain how to add a new action to a controller
after the controller has already been created.
- Add or modify the CSS styles to a Rails project.
- Know the hex color codes for the 17 standard HTML named colors.
- Given two hex color components, determine which one is larger.
- Display output from the controller on a web page using IRB.
- Set up a one-many relationship between two models.
- Set up validations for controls on a form.
- Change the values that a select_date control displays.
- Use a session variable to hold state information.
- Answer questions about Rails project source code.
- Use Digest::SHA2.hexdigest to encode passwords.
- Write Rails migrations to add a column or remove a column from a
database.
- Write validations for inputs to a form
- Create regular expressions to validate input strings.
- Given source code for a Rails project, find the errors.
- Given scaffold-generated source code for a Rails project with
a one-to-many relationship, modify the source code as requested.
- Implement login authentication for a scaffold-based or non-scaffold-based controller.
You may bring the Login Authentication tutorial.
- Explain how to create a Rails controller with some views.
- Modify the HTML and CSS files of a Rails project.
- Modify the years displayed in the year of a date entered on
the form included in the new or edit view of a scaffold.
- Display output from the
controller on a web page using ERB.
- Manipulate the contents of a Rails database by using ActiveRecord methods
typed or loaded from the Rails console.
- Write ERB code to display data from a database table in a view.
- Predict the output of a Rails project:
(a) non-scaffold project, (b) scaffold project, (c) seed file.
- Modify a scaffold-based project according to specifications.
- Designate a view of a Rails project as the root node.
- Add a tooltip to a control or image.
- Write jQuery (or CoffeeScript if you prefer) statements to add an
event handler to a control that changes CSS properties of one or more controls.
- Answer short essay questions. For example:
- How is HTML5 different than earlier versions of HTML?
- Explain what an array is and how it is used in Rails.
- How to the usual Rails scaffold-generated routes differ from nested routes?
- Explain what a session variable is.
- Explain how to create a Rails application using scaffold software, according
to a simple database design.
- Explain the difference between the HTTP GET and POST methods.
- What does REST mean? How is it related to CRUD?
- What is the difference between yield and render?
- Explain the difference between JavaScript, jQuery, and CoffeeScript.