joshua asem
2006-Jun-16 15:03 UTC
[Rails] Not able to recognize helper class method in controller!
Hi, Not able to recognize helper class method in controller! When I try to call some method "get_formatted()" in my controller, it says local method not recognized. Please help me out. Thanks, josua -- Posted via http://www.ruby-forum.com/.
Alan Francis
2006-Jun-16 15:12 UTC
[Rails] Re: Not able to recognize helper class method in controller!
joshua asem wrote:> Hi, > > Not able to recognize helper class method in controller! > > When I try to call some method "get_formatted()" in my controller, it > says local method not recognized. > > Please help me out. > > Thanks, > josuaHi, by default helpers are for views. You could probably include the module manually, but thats not really what they''re for. A. -- Posted via http://www.ruby-forum.com/.
joshua asem
2006-Jun-16 16:13 UTC
[Rails] Re: Not able to recognize helper class method in controller!
Hi, When I tried accessing in controller like this : MyHelper::get_team_leve_report I got the same problem. Just help me out in making my controller to transfer some of my code to the helper class. Thanks, joshua -- Posted via http://www.ruby-forum.com/.
Brian Hogan
2006-Jun-16 16:30 UTC
[Rails] Re: Not able to recognize helper class method in controller!
helpers are for views. If you need to move code out of the controller, ask these questions: 1. Is it used in all controllers? if yes then put it in application.rb 2. Is it related to formatting data? if yes, consider formatting the data in the view instead of the controller 3. Is it manipulating or doing complex business logic? if yes, it should be in the model. Controllers should really only contain flow logic.... basically, receive and route user requests. On 6/16/06, joshua asem <ur_joshua@yahoo.com> wrote:> > Hi, > > When I tried accessing in controller like this : > MyHelper::get_team_leve_report > > I got the same problem. > > Just help me out in making my controller to transfer some of my code to > the helper class. > > Thanks, > joshua > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060616/7a536124/attachment.html