On Feb 7, 1:28 pm, Me <chabg...@gmail.com> wrote: > OK, so you can only call functions in a controller that are in a > model?
You can call methods from pretty much anywhere, but that is not the point. In Rails, you want to follow their MVC pattern to get the most of the framework.You want to call methods within the scope of where you are at. The browser requests go from Dispatcher -> Controller -> View The purpose of the controller is to get the request, maybe validate the user, then instantiate an object that will be rendered in the view. That's it. Any logic about the specifics of how to instantiate the object should be handled by the model classes. So in that part, you are correct when you say "only call functions in a controller that are in a model". You are making a call to instantiate an object that will be used in the view. The model classes usually have a database back end but it does not have to be. It is common to have model classes for specialized reports for example, that have aggregation methods, etc. So you should create a model class for what you are trying to do, to separate those methods in their own domain. Finally, the purpose of the Helper classes is to provide methods for the View. When you need to format something, etc. you put call methods in either the controller_helper class or the generic application helper class. Hope that helps. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---