lib/jbuilder/jbuilder_template.rb in jbuilder-1.5.0 vs lib/jbuilder/jbuilder_template.rb in jbuilder-1.5.1
- old
+ new
@@ -1,8 +1,14 @@
require 'action_dispatch/http/mime_type'
class JbuilderTemplate < Jbuilder
+ class << self
+ attr_accessor :template_lookup_options
+ end
+
+ self.template_lookup_options = { :handlers => [:jbuilder] }
+
def initialize(context, *args, &block)
@context = context
super(*args, &block)
end
@@ -52,10 +58,11 @@
end
end
protected
def _handle_partial_options(options)
- options.reverse_merge!(:locals => {}, :handlers => [:jbuilder])
+ options.reverse_merge! :locals => {}
+ options.reverse_merge! ::JbuilderTemplate.template_lookup_options
collection = options.delete(:collection)
as = options[:as]
if collection && as
array!(collection) do |member|
\ No newline at end of file