This project is archived and is in readonly mode.

#1435 ✓committed

Unify ActionController::Base#render

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

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

Comments and changes to this ticket

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=""></a>

Referenced by