Location of Helper Classes?

According to the Agile Development book, in ch 17 on helpers it says:

“A helper is simply a module containing methods that assist a view.
Helpers are output-centric”

I expect to refactor a lot of code into a few library classes that
really have nothing to do with views or output. This would be mostly
math related functions. In the past I’ve just stuck another class
definition at the end of a controller, but I’m pretty sure thats NOT the
rails way to do it.

Do these libraries really belong in app/helpers or am I just reading too
much into the books definition of a helper?

Thanks

Gary

Hi Gary,

I expect to refactor a lot of code into a few library classes that
really have nothing to do with views or output. This would be mostly
math related functions. In the past I’ve just stuck another class
definition at the end of a controller, but I’m pretty sure thats
NOT the
rails way to do it.

Do these libraries really belong in app/helpers or am I just
reading too
much into the books definition of a helper?

I believe you should keep your library classes in the lib/ directory.

Regards,
Andy S.

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