search for: main_ingredi

Displaying 1 result from an estimated 1 matches for "main_ingredi".

Did you mean: main_ingress
2006 Jul 30
8
Method_missing from Ruby for Rails book
...Cookbook attr_accessor :title, :author def initialize @recipes = [] end def method_missing(m, *args, &block) @recipes.send(m, *args, &block) end end cb = Cookbook.new cb << recipe_for_cake cb << recipe_for_chicken beef_dishes = cb.find_all {|recipes| recipe.main_ingredient == "beef" } I''m getting callable.rb:14: undefined local variable or method `recipe_for_cake'' for main:Object (NameError) so apparently method_missing is not working. Stuart