This project is archived and is in readonly mode.

#524 ✓resolved
Tim Haines

render :template observes locals, so should render :action

Reported by Tim Haines | July 1st, 2008 @ 01:08 PM | in 2.x

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.

Comments and changes to this ticket

  • Pratik

    Pratik July 1st, 2008 @ 04:35 PM

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

  • Tim Haines

    Tim Haines July 1st, 2008 @ 08:47 PM

    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.

  • Repository

    Repository July 2nd, 2008 @ 04:37 AM

    • 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...

  • Repository

    Repository July 2nd, 2008 @ 04:37 AM

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

    Signed-off-by: Pratik Naik

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

  • tribalvibes

    tribalvibes October 26th, 2010 @ 12:21 AM

    • 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.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages