Created
April 4, 2012 19:37
-
-
Save darrenboyd/2305004 to your computer and use it in GitHub Desktop.
A Rails Responder for mrss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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