lib/action_view/lookup_context.rb
def with_layout_format
        if formats.size == 1
          yield
        else
          old_formats = formats
          _set_detail(:formats, formats[0,1])

          begin
            yield
          ensure
            _set_detail(:formats, old_formats)
          end
        end
      end
# A method which only uses the first format in the formats array for layout lookup.
# This method plays straight with instance variables for performance reasons.
A method which only uses the first format in the formats array for layout lookup.
This method plays straight with instance variables for performance reasons.
A method which only uses the first format in the formats array for layout lookup . This method plays straight with instance variables for performance reasons .
def with_layout_format
        if formats.size == 1
          yield
        else
          old_formats = formats
          _set_detail(:formats, formats[0,1])
          begin
            yield
          ensure
            _set_detail(:formats, old_formats)
          end
        end
      end
def with_layout_format if formats . size == 1 yield else old_formats = formats _set_detail ( :formats , formats [ 0 , 1 ] ) begin yield ensure _set_detail ( :formats , old_formats ) end end end
A method which only uses the first format in the formats array for layout lookup.
A method which only uses the first format in the formats array for layout lookup .