Chap. 5, Confusion: Tying Controls to Models
Hi, All:
I've been reading through this book, and it's been *super* up until the section in chapter 5 on tying controls to models. The author says that "cruncher" is the name of a model object, yet in input.rhtml (p. 147), that html is called *before* any cruncher object is created (in the at method).
Furthermore, I tried changing
text_field("cruncher","crunch") ===> text_field("tcruncher","xcrunch"), and, after adjusting params[:cruncher] to params[:tcruncher], and @data_hash[:crunch] to @data_hash[:xcrunch], things still worked.
I guess I don't understand what the parameters "cruncher" and "crunch" really signify. The book states that they are supposed to be named after the model and attribute, respectively, but they don't have to be, as my experimenting demonstrated.
Is it just convention that the arguments to text_field be the lowercase name of the model and its attribute, or will this turn out to be useful later on?
Any enlightenment would be most appreciated!
Michael Rogers
|