Where to put utility code

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

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

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 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