I have a rails controller and a resque worker. Both share a couple of functions. Where should I put these functions so that I can follow the DRY principle and Rails conventions?
To me, this sounds like a good case for a service layer. One of my coworkers wrote up a nice summary of the concept: http://blog.carbonfive.com/2012/01/10/does-my-rails-app-need-a-service-layer/
In Domain-Driven Design, Evans defines a service as an operation offered as an interface that stands alone in the model. In other words, a service is an action, not a thing. And instead of forcing the operation into an existing object, we should encapsulate it in a separate, stateless service.
...
A domain service scripts a use-case involving multiple domain objects. Forcing this logic into a domain object is awkward because these use-cases often involve rules outside the responsibility of any single object.
Service layers are a common feature in many other web app MVC frameworks and something many Rails applications choose to use when fat models do not provide an appropriate encapsulation of responsibilities in their problem domain.
Without knowing more I'm afraid I can't offer a more specific answer. My next step would be to try to consider what this service should be named. Is it a factory that build something we have a name for? Do is fulfill a specific role we can name it after?