Where should libraries go in Rails 3? -
where's recommended location libraries in rails 3? simple 'lib'?
i'm not sure because 'lib' seems more rails 2 remnant, considering it's no longer auto-loaded (and there lot of discussion that, apparently).
initializers more (obviously) initialization tasks such overrides.
specifically have small module attachment handling (paperclip doesn't fit here) that's large , distinct include in model, not generic or worthwhile enough implement gem.
from functionality standpoint lives somewhere in middle among model, view, , controller. makes sound helper, in rails helpers intended views afaik.
should put in 'lib' , autoload in application.rb? or maybe create custom form builder handle presentation (or both).
i know how make work, i'm hoping learn new. :)
lib still right place put these kind of things.
autoloading lib removed in rails 3 because of way engines work, because it's easy add autoload_paths if want automatically loaded , if not, can require needed. lib still in load path, don't need specify where module or class you're requiring is.
you're correct, helpers intended view, , not place put model-related logic.
i'd put module in lib, , require , include in model needed.
Comments
Post a Comment