Skip to content

Commit

Permalink
Pull template lookup options in a separate accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
rwz committed Aug 24, 2013
1 parent bfa38e9 commit 404c18d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/jbuilder/jbuilder_template.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
require 'action_dispatch/http/mime_type'

class JbuilderTemplate < Jbuilder
class_attribute :template_lookup_options,
:instance_reader => false,
:instance_writer => false,
:instance_predicate => false

self.template_lookup_options = { :handlers => [:jbuilder] }

def initialize(context, *args, &block)
@context = context
super(*args, &block)
Expand Down Expand Up @@ -54,7 +61,8 @@ def cache!(key=nil, options={}, &block)

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]

Expand Down

0 comments on commit 404c18d

Please sign in to comment.