[Rails] Method_missing from Ruby for Rails book
Dark Ambient
sambient at gmail.com
Mon Jul 31 00:02:40 GMT 2006
David,
I'm lost now . The variable as recipes should be fine. recipe is
undefined but I thought the purpose of the code sample was to show how
method_missing still responds to the call. ?
It's not an easy chapter :) so perhaps I'm missing something.
Stuart
On 7/30/06, dblack at wobblini.net <dblack at wobblini.net> wrote:
> Hi --
>
> On Sun, 30 Jul 2006, Dark Ambient wrote:
>
> > David,
> >
> > I had added the class Recipe and still received same error.
> > Furthermore, the recipe_for_cake and chicken, are you saying those replace
> > the
> > cb << recipe_for cake ?
>
> No; what you've got is right, except:
>
> > beef_dishes = cb.find_all {|recipes| recipe.main_ingredient ==
> > "beef" }
>
> Your loop variable is recipes but you're using recipe (which is
> undefined) inside the loop.
>
>
> David
>
> --
> http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
> ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
> http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log
> http://www.manning.com/black => book, Ruby for Rails
> http://www.rubycentral.org => Ruby Central, Inc.
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
More information about the Rails
mailing list