If I want to have functions to be called inside controllers, where should I put them?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you want it to be local to a controller then all you need to do is to add it to the controller you wish to use.
to all controllers you can put it inside the application controller, because all controlers are sub classed.
ApplicationController
If you want access in your views then you can create a helper
ApplicationHelper