Little tip to allow the use of helper methods in controllers

June 30, 2010
A little tip i've found while watching a rails cast that i found useful...

In a controller, there's a "@template" instance that you can call helper methods on. 
 
example 
 
Helper -
 
def default_title
"Ruby on Rails Specialists | Savantis "
end
 
Controller - 
 
def index
@meta_title = @content.meta_title + @template.default_title
end

Bookmark and Share

Why Ruby on Rails ?

Ruby On Rails Logo
Find out how Ruby on Rails could save your company time & money!

Latest News

Amazon S3 in AWS Management Console Demo

June 10, 2010
Amazon announce that the AWS Management Console now provides a simple and intuitive web interface for managing your Amazon S3 resources.
Read more »

Open Source ?

open source technology
Find out why savantis use open source technology & how this can benefit you !