Forum: Ruby on Rails where to put utility code.

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.
84b671b8b0f505b6f67322ff2446a30a?d=identicon&s=25 Jon Shen (Guest)
on 2006-04-12 04:08
(Received via mailing list)
Hi All,

I am new to "ruby on rails".

I have some common utility classes.

I am not sure where to put this kind of code.   components\  or lib\  ?

Any comment is appreciated!

-Jon
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-04-12 12:55
(Received via mailing list)
Jon

    > I have some common utility classes.
    > I am not sure where to put this kind of code.

Advice:
   1/ place them in /lib,
   2/ make them reloadable

         ex:   lib/my_stuff.rb
             class MyStuff
                  include Reloadable
                ...
             end

     => you won't have to restart the server each time you modify them,
in developement mode

Alain
D4b246038154d7cc2363256bd25a4fe0?d=identicon&s=25 Larry White (Guest)
on 2006-04-12 22:25
(Received via mailing list)
Hi,

I tried the reloadable option as described below and got an
uninitialized
constant error.  Is this a 1.1 feature?  If not, what else needs to
happen
to make this magic work in 1.0?

thanks.
This topic is locked and can not be replied to.