To Exam Info

IT231 -- Final Review Questions

 

  1. Define these terms:

    See the course notes for these definitions.
     
  2. How do you attach a CSS class to a control?
     
    Ans: With :class => 'ctrl' where .ctrl is defined in the CSS file.
     
  3. What types of validation are available in Rails?
     
    Ans: validates_presence_of, validates_length_of, validates_uniqueness_of, validates_format_of, validates_numericality_of
     
  4. How do you execute a Ruby script from the Rails console?
     
    Ans: load 'rubyfile.rb'
     
  5. 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.
     
  6. 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.
     
  7. What are the the database manipulation methods available from a model?
     
    Ans: find, all, new, save, delete, delete_all
     
  8. How do you pass data from a view to a controller?
     
    Ans: With params statements.
     
  9. 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.
     
  10. What is a websafe color?
     
    Ans: Colors all of whose color components consist of 00, 33, 66, 99, CC, or FF.
     
  11. Convert the string "turkey" to ASCII and base-64. Ans: