Created
June 19, 2012 23:26
-
-
Save maxjustus/2957127 to your computer and use it in GitHub Desktop.
default json responder for rails controllers
This file contains hidden or 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
module Responders | |
class JsonTemplateResponder < ActionController::Responder | |
def to_json | |
render :json => {:html => controller.render_to_string("#{controller.action_name}.html")} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment