Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
Forked from technicalpickles/example.json.rb
Created September 25, 2009 17:45
Show Gist options
  • Save jamesarosen/193704 to your computer and use it in GitHub Desktop.
Save jamesarosen/193704 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