Creating a search form

To create a search form, enter the following code form_tag: This is the default helper for creating a form. It’s first parameter, /search is the action and the second parameter specifies the HTTP method. For search forms, it is important to always use the method get label_tag: This helper creates an html “ tag. text_field_tag: This will create an input … 

 

Helpers for form elements

Checkboxes This will generate the following html “` I own a dog I own a cat [/ruby] Radio Buttons This generates the following HTML Text Area To create a larger text box, it is recommended to use the text_area_tag This will create the following HTML Number Field This will create an input element To specify a range of … 

 

Fat Model, Skinny Controller

“Fat Model, Skinny Controller” refers to how the M and C parts of MVC ideally work together. Namely, any non-response-related logic should go in the model, ideally in a nice, testable method. Meanwhile, the “skinny” controller is simply a nice interface between the view and model. In practice, this can require a range of different …