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
Valves supplier, valves manufacturer, fittings, ball valves, butterfly valves, sanitary butterfly valves, sanitary ball valves, sanitary fittings, valves manufacturers, ball valve, butterfly valve, sanitary unions, sanitary clamp unions, sanitary check valves, sanitary sight glasses, flanges, butterfly valve handles
I'm a newbie to rails and adding this post to clarify the railscast. I was wondering why the def was called "self.find_incomplete" when the original code was "find_all_by_complete". It took me a few minutes, but it's called "incomplete" because the data being queried is a boolean condition and the query is looking for the "false" conditions (i.e. tasks that are not completed) ergo the naming if "incomplete". Yes, a Homer Simpson DOH! moment...
i love [url=http://www.gavots.com] armani sunglasses [/url]very much
It is amazing! Thanks! This was a really useful episode, ROR really is awesome in that it lets you write code like that! Thanks for very good information. Excellent article that will provide the incentive and basis for my works.I wonder if I can mention the article as a bibliographic reference in my work. Thanks!
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
This was a really useful episode, ROR really is awesome in that it lets you write code like that! Thanks for very good information. Excellent article that will provide the incentive and basis for my works.
YES! Great piece, keep up the terrific work. This is the type of information that should gain recognition for it’s craft. More writers should learn from you. This is right on the money.






