lib/rabl/partials.rb in rabl-0.8.1 vs lib/rabl/partials.rb in rabl-0.8.2

- old
+ new

@@ -22,10 +22,10 @@ # options can have :source_location (source filename) def object_to_hash(object, options={}, &block) return object if object.nil? return [] if is_collection?(object) && object.blank? # empty collection engine_options = options.reverse_merge(:format => "hash", :view_path => @_view_path, :root => (options[:root] || false)) - Rabl::Engine.new(options[:source], engine_options).render(@_scope, :object => object, &block) + Rabl::Engine.new(options[:source], engine_options).render(@_scope, :object => object, :locals => options[:locals], &block) end # Returns source for a given relative file # fetch_source("show", :view_path => "...") => "...contents..." def fetch_source(file, options={})