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.
Wes G. (Guest)
on 2006-04-17 20: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
Chang Sau S. (Guest)
on 2006-04-17 21: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 G. wrote:
>
>


--
Sau S.

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
Wes G. (Guest)
on 2006-04-17 21:32
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
Chang Sau S. (Guest)
on 2006-04-17 21: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 G. wrote:
>>>
>
--
Sau S.

http://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
Sopane T. (Guest)
on 2013-10-29 14: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.