Best place for generic utility classes?

I have some code that is simply formatting and parsing URLs and I really
don’t want to associate it with a view or a controller or a model - I
just want it to be available as a utility class.

Where should this utility class go?

I would have to import it into my controller using “require” correct?

Thanks,
Wes

Try putting it in a helper. If you want it to be available for all views
put it in application_helper.rb

Wes G. wrote:


Sau S.


http://read.saush.com
http://jaccal.sourceforge.net

I don’t want to use it from a view - I want to use it from a controller
or model.

Chang Sau S. wrote:

Try putting it in a helper. If you want it to be available for all views
put it in application_helper.rb

Wes G. wrote:


Sau S.

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net

Hi

Please advice i have ACR38 and a mcr200and i would like to know how to
read and write an Emv ic chip card.
i need help with this regard, im willing to pay a price.

Thanks
Sops

You can put it as a library, just include it in your controller or
model.
Alternatively if it’s for controllers only you might want to put it in
application.rb which is the base class for all controllers, you don’t
need to include a library then.

Wes G. wrote:


Sau S.


http://read.saush.com
http://jaccal.sourceforge.net

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