Forum: Ruby on Rails Best place for generic utility classes?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-17 18:55
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
D2a5b7975f49e051c1de10f98ea81f63?d=identicon&s=25 Chang Sau Sheong (Guest)
on 2006-04-17 19:03
(Received via mailing list)
Try putting it in a helper. If you want it to be available for all views
put it in application_helper.rb

Wes Gamble wrote:
>
>


--
Sau Sheong

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-17 19:32
I don't want to use it from a view - I want to use it from a controller
or model.

Chang Sau Sheong wrote:
> Try putting it in a helper. If you want it to be available for all views
> put it in application_helper.rb
>
> Wes Gamble wrote:
>>
>>
>
>
> --
> Sau Sheong
>
> http://blog.saush.com
> http://read.saush.com
> http://jaccal.sourceforge.net
D2a5b7975f49e051c1de10f98ea81f63?d=identicon&s=25 Chang Sau Sheong (Guest)
on 2006-04-17 19:46
(Received via mailing list)
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 Gamble wrote:
>>>
>
--
Sau Sheong

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
7dc905dd6179635d49d952ee0b4592eb?d=identicon&s=25 Sopane T. (sopane_t)
on 2013-10-29 13:34
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
This topic is locked and can not be replied to.