resources_for: Add parameter for custom sorting