I want to generate urls from a model's class method. I've done this before from an instance method by simply including ActionController::UrlWriter
-- I tried including this in the instance definition scope and also the class definition scope, to no avail.
class Foo < ActiveRecord::Base
# only works for instance methods
# include ActionController::UrlWriter
class << self
# results in this error: undefined method `default_url_options' for Class:Class
# include ActionController::UrlWriter
def my_method
return user_sprockets_url(:thingy => 'blue')
end
end
end