I'm just curious to know is there any benefit in putting require in environment.rb vs in model/controller file? I guess it's always better to use it in environment.rb, even when only one controller requires it, since once it's loaded it's always there anyway. Am I right on this?
Reynard wrote:
I'm just curious to know is there any benefit in putting require in environment.rb vs in model/controller file? I guess it's always better to use it in environment.rb, even when only one controller requires it, since once it's loaded it's always there anyway. Am I right on this?
I'd opt the other direction... if only one controller requires whatever, that controller should say so. When I see something in environment.rb, I expect to see wide-spread usage in the application.
Seeing "require 'will_paginate'" in environment.rb makes sense, as all our controllers paginate.
Seeing "require 'pdf/writer' and require 'pdf/simpletable' in just a few controllers shows that only those controllers deal with requests for generating PDF files.