Skip to content

Instantly share code, notes, and snippets.

View jpowell's full-sized avatar

Justin Powell jpowell

View GitHub Profile
@jpowell
jpowell / nbuilder.rb
Created April 21, 2012 18:58 — forked from sishen/gist:1019347
Nokogiri Template Builder. (Rails 3.0)
require 'action_view'
module ActionView::Template::Handlers
class NokogiriBuilder
class_attribute :default_format
self.default_format = Mime::XML
def call template
require 'nokogiri'
"xml = ::Nokogiri::XML::Builder.new { |xml|" +