Skip to content

ViewModels#controller_method

floere edited this page Sep 13, 2010 · 1 revision

Sometimes you don’t want to always call controller.logger to get the logger. You might want to call logger directly in the view model logger.info("Hello from the View Model").

controller_method :logger, :current_user

This delegates logger and current_user on the view_model to the controller. Of course, you can use more than two method names.

Clone this wiki locally