Best place for generic utility classes?


#1

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


#2

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


#3

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


#4

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


#5

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