This is where helpers come in. Assuming you want this method to be
available to all of your controllers, you'd put it in app/helpers/
Once you've done that, you can call msg in any controller or view in
your app. Note that you're still going to get an error if you type
"msg" at the console, but the method will be globally available from
within any controller or view. If you truly want the method to be
global you'll need to put it in a library - but I don't think that's
really what you're after.