Application_helper.rb vs application.rb


#1

I find that I want to put the same methods into both of these files.
Whats the best way to get away with a single implemenation?

Gareth


#2

Am Donnerstag, den 16.03.2006, 19:00 +0100 schrieb Gareth R.:

I find that I want to put the same methods into both of these files.
Whats the best way to get away with a single implemenation?

You can make controller methods available in view as helper methods
using the following macro:

controller

def my_method

do something here

end

helper_method :my_method

The other way is, to include a module with your method in both files.


Norman T.

http://blog.inlet-media.de