Hi, I have string or symbol that holds a controllers name (like ''user'' or :user). How can I call one of the class methods of this controller? Thanks in advance _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Thursday 17 November 2005 15:42, Onur Turgay wrote:> Hi, > I have string or symbol that holds a controllers name (like ''user'' > or :user). How can I call one of the class methods of this > controller?Try: str = "user" # or :user kontroller = "#{str}_controller".camelize.constantize kontroller.any_method_you_want> Thanks in advance-- Dmitry V. Sabanin http://sabanin.ru