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.

Unify ActionController::Base#render

#1435

Now that we've unified ActionView::Base#render, it's time to do the same with ActionController::Base#render. The changes should be as follows:

Make render(string) expand to render(:template => string)

Unify the :file/:template/:action calls to just be :template (which then can be contracted to render(string)).


render :file => '/Users/what/ever.html.erb'   -> render('/Users/what/ever.html.erb') (begins with forward slash)
render :template => 'other_controller/action' -> render('other_controller/action') (same)
render :action => 'hello'                     -> render('hello') (Does not have any slash)

From Admin::Bar controller:


render('foo/bar')                                # Renders bar.html.erb of Admin::Foo controller (current namespace)
render :template => 'foo/bar', :namespace => '/' # Renders bar.html.erb of Foo controller from top namespace

Reported by DHH · November 22nd, 2008 @ 05:21 PM

State: committed
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Repository
    Repository

    (from [061952392afd1dae1aa97a816e9a0c79df7c4514]) Make ActionController#render(string) work as a shortcut for render :file => string. [#1435]

    Examples: # Instead of render(:file => '/Users/lifo/home.html.erb') render('/Users/lifo/home.html.erb')

    Note : Filename must begin with a forward slash ('/') http://github.com/rails/rails/co...

    December 25th, 2008 @ 09:45 PM

  2. Repository
    Repository

    (from [d67e03871eabb912434dafac3eeb8e6ea7c5585f]) Make ActionController#render(string) work as a shortcut for render :template => string. [#1435]

    Examples: # Instead of render(:template => 'controller/action') render('controller/action')

    Note : Argument must not begin with a '/', but have at least one '/' http://github.com/rails/rails/co...

    December 25th, 2008 @ 10:37 PM

  3. Repository
    Repository

    (from [cd1d6e8768ae13b11bc343701037b20ad35e6f1e]) Make ActionController#render(string) work as a shortcut for render :action => string. [#1435]

    Examples: # Instead of render(:action => 'other_action') render('other_action')

    Note : Argument must not have any '/' http://github.com/rails/rails/co...

    December 25th, 2008 @ 11:07 PM

  4. Repository
    Repository

    (from [80307c8b0a889acc7abb7f4e52fd4c02e1063ba8]) Make ActionController#render(symbol) behave same as ActionController#render(string) [#1435] http://github.com/rails/rails/co...

    December 26th, 2008 @ 01:13 AM

  5. DHH
    DHH
    • State changed from new to committed

    January 8th, 2009 @ 09:24 PM