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
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
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:
def my_method
end
helper_method :my_method
The other way is, to include a module with your method in both files.
–
Norman T.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs