Skip to content

Instantly share code, notes, and snippets.

@foca
Forked from technicalpickles/example.json.rb
Created September 14, 2009 05:01
Show Gist options
  • Save foca/186512 to your computer and use it in GitHub Desktop.
Save foca/186512 to your computer and use it in GitHub Desktop.
{
:a => 2,
# NOTE for partials, you need to include the format
# otherwise, it'll fail to find byows/_byow.erb even if byows/_byow.html.erb exists
:b => render(:partial => 'example.html')
}.to_json
class RbTemplate < ActionView::TemplateHandler
include ActionView::TemplateHandlers::Compilable if defined?(ActionView::TemplateHandlers::Compilable)
def compile(template)
template.source
end
end
ActionView::Template.register_template_handler(:rb, RbTemplate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment