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 :template observes locals, so should render :action

#524

render :action and render :partial allow you to pass a :locals hash. render :template doesn't - even though the documentation says it behaves the same way as render :action.

This patch makes render :template observer the :locals hash, and adds a test and documentation.

Reported by Tim Haines · July 1st, 2008 @ 01:08 PM

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

Activity

  1. Pratik
    Pratik

    I'm getting ActionView::MissingTemplate exception when running tests.

    July 1st, 2008 @ 04:35 PM

  2. Tim Haines
    Tim Haines

    Hi Pratik, I was expecting I'd made atleast 1 newb mistake somewhere. The method I used to generate the patch hasn't included the new template I created. I'll upload a new one once I figure out the right git command.

    July 1st, 2008 @ 08:47 PM

  3. Repository
    Repository
    • State changed from new to resolved

    (from [f5052dd8a39099e4930faafe9b01e63ced2f6391]) Make sure render :template works with :locals. [#524 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 2nd, 2008 @ 04:37 AM

  4. Repository
    Repository

    (from [6303ba0c12511b1021ffc84240b43e06e93c9269]) Make sure render :template works with :locals. [#524 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 2nd, 2008 @ 04:37 AM

  5. tribalvibes
    tribalvibes
    • Title changed from render :template observes locals to render :template observes locals, so should render :action

    Actually this is still a problem as render :action does not allow you to pass a :locals hash, which it should for consistency as all the other flavors of render allow this.

    Please re-open this and (someone) let's patch render :action to also accept a :locals hash. Any problems with this? See also #1522.

    October 26th, 2010 @ 12:21 AM