Permalink
Browse files

Fixes for using action view template in isolation.

  • Loading branch information...
1 parent d9c2882 commit 6093d88ed8b50647c1ca235cd4c167ee78955e56 @josevalim josevalim committed Nov 29, 2011
View
1 actionpack/lib/action_view.rb
@@ -33,6 +33,7 @@ module ActionView
autoload :AssetPaths
autoload :Base
autoload :Context
+ autoload :CompiledTemplates, "action_view/context"
autoload :Helpers
autoload :LookupContext
autoload :PathSet
View
11 actionpack/lib/action_view/template/handlers/builder.rb
@@ -6,12 +6,21 @@ class Builder
self.default_format = Mime::XML
def call(template)
- require 'builder'
+ require_engine
"xml = ::Builder::XmlMarkup.new(:indent => 2);" +
"self.output_buffer = xml.target!;" +
template.source +
";xml.target!;"
end
+
+ protected
+
+ def require_engine
+ @required ||= begin
+ require "builder"
+ true
+ end
+ end
end
end
end
View
2 actionpack/lib/action_view/template/handlers/erb.rb
@@ -1,5 +1,5 @@
require 'action_dispatch/http/mime_type'
-require 'active_support/core_ext/class/attribute_accessors'
+require 'active_support/core_ext/class/attribute'
require 'erubis'
module ActionView

0 comments on commit 6093d88

Please sign in to comment.