Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

render_to_string :inline before normal render causes assert_template failures

#1383

When render_to_string :inline => ... is called in a controller action a normal template render later occurs, the response.template's @_first_render variable is set to an instance of InlineTemplate rather than the file-based template that was rendered and returned in the response.

The attached patch causes render_to_string to reset @_first_render to nil when it is set to an InlineTemplate.

This caused failures in my application test suite upon upgrading to the 2.2 branch.

Reported by Luke Melia · November 16th, 2008 @ 05:09 AM

State: resolved
Milestone: 2.x
Assigned to: josh josh
Importance: none

Activity

  1. DHH
    DHH
    • Assigned user set to josh

    November 16th, 2008 @ 08:43 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [f7a8e394008f62e8f07874f6c679e10c40e8de57]) Prevent assert_template failures when a render :inline is called before rendering a file-based template [#1383 render_to_string :inline before normal render causes assert_template failures state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    November 18th, 2008 @ 04:11 AM

  3. Repository
    Repository

    (from [75fb8dfb996f5c5d8b64d10ce7b27eeb681d5316]) Prevent assert_template failures when a render :inline is called before rendering a file-based template [#1383 render_to_string :inline before normal render causes assert_template failures state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    November 18th, 2008 @ 04:11 AM

  4. Jarl Friis
    Jarl Friis
    • Importance changed from to

    November 1st, 2010 @ 07:37 PM