To Lecture Notes

IT 231 -- 10/25/12

 

Review Questions

  1. Write a Rails view that displays 1000 lines on a page like this: Use the Range 1..1000 with the each method.

  2. Explain the difference between FormTagHelper and FormHelper methods.
     
    Ans: FormTagHelper methods are used to implements HTML forms and controls that are not connected to a database. FormHelper method work closely with the database to move data from the form to a database and vice versa. FormTagHelper method names all end with _tag. FormHelper method names do not end with _tag.
     
  3. Find the mistakes in this view that uses FormHelper methods:
  4. Find the mistakes in this controller code:
  5. Find the mistakes in this view code:
  6. Create a Guestbook project using FormHelper methods. The model should be named Comment with fields name and message. The views for the Controller Comments should be new and display_all. Include the created_at field on the display_all view. Recall that the created_at field is automatically created when you create the model or scaffold.
    Ans: See Example 30 (GuestBook Example).

 

The Array Method collect

 

One-to-many Relationships

 

Final Project