To Exam Info
IT231 -- Final Review Questions
- Define these terms:
Array
Range
Model
FormTagHelper
FormHelper
Validation
Digest
Hex
Base64
ASCII
One-to-many Relationship
See the course notes for these definitions.
- How do you attach a CSS class to a control?
Ans: With :class => 'ctrl' where .ctrl is defined in the CSS file.
- What types of validation are available in Rails?
Ans: validates_presence_of, validates_length_of, validates_uniqueness_of,
validates_format_of, validates_numericality_of
- How do you execute a Ruby script from the Rails console?
Ans: load 'rubyfile.rb'
- Explain the difference between FormTagHelper and FormHelper methods.
Ans: FormTagHelper methods are meant to be used without a database;
the controls created by FormHelper methods correspond to the fields
of a table in a database.
- Explain the difference between the following: for, each, collect.
Ans: for and each are used to repeat a calculation or operation for
each element in an array or range. collect repeats a calculation for
each element of an array, then collects all these calculations together
into a new array.
- What are the the database manipulation methods available from a model?
Ans: find, all, new, save, delete, delete_all
- How do you pass data from a view to a controller?
Ans: With params statements.
- What are the 17 HTML colors and their hex color codes?
Ans: red #FF0000, lime #00FF00, blue #0000FF, yellow #FFFF00, aqua #00FFFF,
fuschia #FF00FF, maroon #800000, green #008000, navy #000080, olive #808000,
teal #008080, purple #800080, black #000000, white #FFFFFF, gray or grey
#808080, silver #C0C0C0.
- What is a websafe color?
Ans: Colors all of whose color components consist of 00, 33, 66, 99, CC,
or FF.
- Convert the string "turkey" to ASCII and base-64. Ans:
dHVya2V5