Topic: Where do I put routines that can be accessed by models?
I cant figure out where to put a routine that can be accessed by a model, other than the model itself.
The original code came from the new Agile Web Development With Rails book, but Im trying to add some path processing to the upload files.
class Path < ActiveRecord::Base
filename, parent = Path.processfilename(file_field.original_filename)
I have tried adding the 'processfilename' method to my Path < ActiveRecord::Base class (which is where I want it to live since many classes will be using it) but each time my UploadedFile class tries to access it, it says 'undefined method for Path:Class.
I have also tried to put it in the controller and the helper, and I always get the same result.
Any help/suggestions would be greatly appreciated.
Last edited by poschs (2007-01-02 10:47:32)