If i have Image class and i’d like to add ‘create_thumbnail’ method to
it, which will later be called from product controller, where to put
this method and how to call it?
I’ve tried putting it inside image controller and image model, then call
it like Image.create_thumbnail, but it didn’t work - undefined method
`create_thumbnail’ for Image:Class.
Do you want a class method or an instance method?
Class methods look like this:
# return a thumbnail image here
# You probably need to pass some arguments to this method
# so it knows what to do
but instance methods look like this:
# return a thumbnail image of this object
Notice there’s no “self.” prefixed to the method name here.