Move ruby code into a controller method