missing_method in Ruby
missing_method is one of cool features of Ruby.
Code:
class A
def method_missing(name, *args)
puts "Oops! \"#{name}\" method is missing"
end
end
a = A.new
a.howdy
Output:Oops! "howdy" method is missingRails ActiveRecord uses it for dynamic finders: here
Post a Comment