Very nice example, great work!
Hi Ryan,
On this topic "Move Find into Model", I have queries which I hope you could help to enlighten me:
I provide CRUD of books. First, user will have to select the action (i.e. C, R, U or D) from the menu. Then, a search screen is displayed for user to enter the book title/s which s/he would like to check.
The search string could contain more than one word, * (0 or more character wild card), ? (single character wild card) and so on.
In this case, should the formatting and validation of the search string be also embedded in the Book model, together with the Find in the Book model? If not, where should this be included?
Thank you for your help.
@Lucky, yes, I would put the handling of the search wild cards into the model. That's logic that doesn't belong in the controller.
I am curious about the self.find...
Why is it that this method requires "self." ?
I found an answer to something that has been confounding me about the self. thing. I am learning about OO programming, so I admit that this may seem obvious to a lot of people. Please excuse my ignorance.
Here is a link regarding how this works.
http://wiki.rubyonrails.org/rails/pages/RubyHeadScratching
Thank you Ryan for all the excellent work in your railscasts. I really appreciate the patience and clear mindedness that you demonstrate in your screencasts. You express yourself as a joyful and brilliant person.
i know this is wrong place to write this but i need a solution i want to know how mapping should be done mine case is " A has many B , A has many C, every B has some C which is added to above list which is related to A. so tell me the way to map them . i have mapped B and C to A




