Where to put shared code?

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?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs