Forum: Ruby on Rails Where to put shared code?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F81b58d24f8ad3beab5334c3c3a2001c?d=identicon&s=25 Arrix (Guest)
on 2007-05-07 14:32
(Received via mailing list)
Where should I put shared code in a rails project?
The shared code is neither controller nor view nor model. But putting
it in /lib would require server restart to reflect changes.
Any suggestions?
De271a04fe7a67b884ce75404c1dcc61?d=identicon&s=25 Chris Gernon (kabigon)
on 2007-05-07 18:05
Arrix wrote:
> Where should I put shared code in a rails project?

Where would the code be used? If you want methods to be available in all
your controllers, you can put them in app/controllers/application.rb. If
you want to add methods that will be available to all your views, you
can put them in app/helpers/application_helper.rb. If you want code to
be available everywhere in your project (controllers, views, tests,
migrations, etc.), you'll probably want to create a module in lib.
This topic is locked and can not be replied to.