views:

32

answers:

1

I'm having a conflict between overloaded helper names. ApplicationHelper has a method called 'title' that take 0 arguments LayoutHelper has a method called 'title' that takes 2 arguments

I have a layout that calls the LayoutHelper::title when it should be calling the ApplicationHelper::title. The number of arguments in the call is 0 so it's not ambiguous, but I'm getting a 'wrong number of arguments' error from the resolution to LayoutHelper::title.

Is there a way of specifying the helper class in the call? Like help = ApplicationHelper::base help.title ???

A: 

Ruby does not support overloading of methods. The following article has a good example of how to do "overloading" of sorts, but your logic will have to be in the same function:

http://otype.de/index.php?id=152

Hope that helps!

codykrieger