Skip to content

Instantly share code, notes, and snippets.

@maxjustus
Created June 19, 2012 23:26
Show Gist options
  • Save maxjustus/2957127 to your computer and use it in GitHub Desktop.
Save maxjustus/2957127 to your computer and use it in GitHub Desktop.
default json responder for rails controllers
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