def locals
        @_locals ||= begin
          scope   = controller.instance_variable_get(:"@scope")
          results = ([scope] + resources).compact

          (options[:locals] || {}).tap do |hash|
            results.each do |object|
              hash[key_for(object)] = object
            end
          end
        end
      end
def locals
        @_locals ||= begin
          scope   = controller.instance_variable_get(:"@scope")
          results = ([scope] + resources).compact

          (options[:locals] || {}).tap do |hash|
            results.each do |object|
              hash[key_for(object)] = object
            end
          end
        end
      end
TODO: rename for accuracy