Forum: Ruby on Rails Non-model methods go where?

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.
Joshua Wehner (Guest)
on 2006-01-25 18:12
(Received via mailing list)
Hi all --

I collect two pieces of data from users, then perform a calculation on
this data. Where should I put this calculator this method?

Helpers seem view-oriented, and the result here is not being sent to the
user. Anyway, I tried putting the method in a helper and got a "no
method" error.

At the moment, I have it in another Model, but this seems really lame to
me, so I thought I'd ask.



-- Joshua
Francois Beausoleil (Guest)
on 2006-01-25 19:10
(Received via mailing list)
Hello Joshua !

2006/1/25, Joshua Wehner <rails@thewehners.net>:
> I collect two pieces of data from users, then perform a calculation on
> this data. Where should I put this calculator this method?

You can put anything in lib/.  Just put a class, or some helper
methods and require that file.  You'll then have access to this data.

If you told us more about the data, we might be able to offer more help.

Hope that helps !
This topic is locked and can not be replied to.