Skip to content

Instantly share code, notes, and snippets.

@darrenboyd
Created April 4, 2012 19:37
Show Gist options
  • Save darrenboyd/2305004 to your computer and use it in GitHub Desktop.
Save darrenboyd/2305004 to your computer and use it in GitHub Desktop.
A Rails Responder for mrss
class ApiResponder < ActionController::Responder
# MRSS is not a 'real' type.
# The Media RSS specification builds on top of the RSS
# specification. We want to use the following formats
# in our application...
# - xml
# - json
# - rss
# - mrss
#
# Adding a custom extension, and building a responder
# seems like the right way to do this.
# Is the the proper way of building a Responder?
def to_mrss
render :text => resource.to_mrss, :content_type => Mime::XML
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment