# Render :action =\> 'list'

**URL:** <https://www.ruby-forum.com/t/render-action-list/55533>\
**Category:** Rails\
**Created:** [March 21, 2006, 11:24pm UTC](https://www.ruby-forum.com/t/render-action-list/55533 "2006-03-21T23:24:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@gonzalo](https://www.ruby-forum.com/u/gonzalo)\
**Post date:** [March 21, 2006, 11:24pm UTC](https://www.ruby-forum.com/t/render-action-list/55533/1 "2006-03-21T23:24:15Z")

</div>

does anybody know what the hell “render :action =\> ‘list’” means???

is “render” a method? is :action a parameter?

thanks a lot.

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@gonzalo](https://www.ruby-forum.com/u/gonzalo)\
**Post date:** [March 21, 2006, 11:31pm UTC](https://www.ruby-forum.com/t/render-action-list/55533/2 "2006-03-21T23:31:21Z")

</div>

Hi Gonzalo

Render is a method of ActionController and ActionView. The docs can be  
found

> **[ActionController::Base](https://api.rubyonrails.org/classes/ActionController/Base.html#M000178)**
>
> Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either it renders a template or redirects to another action.

for the controller version.

The :action =\>‘list’ is a parameter hash to tell the method what to  
render.  
The list action of the controller should be rendered in this case.

There are plenty of good docs available on the [rubyonrails.org](http://rubyonrails.org) site to  
get  
you going. The wiki is a good place to start

Cheers

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@gonzalo](https://www.ruby-forum.com/u/gonzalo)\
**Post date:** [March 21, 2006, 11:34pm UTC](https://www.ruby-forum.com/t/render-action-list/55533/3 "2006-03-21T23:34:48Z")

</div>

render is a method (an instance method on ActionController). :action  
=\> ‘list’ is a literal Hash with one entry. The key is :action (a  
Symbol), and the value associated with that key is ‘list’ (a String).  
That’s equivalent to:  
args = Hash.new  
args[:action] = ‘list’  
render(args)

…but that’s three times as long, and doesn’t communicate the intent  
as well. Hashes are used frequently in Rails because they make method  
calls easier to read, and Ruby doesn’t have ‘real’ keyword arguments  
like Smalltalk and various other languages.

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@gonzalo](https://www.ruby-forum.com/u/gonzalo)\
**Post date:** [March 21, 2006, 11:36pm UTC](https://www.ruby-forum.com/t/render-action-list/55533/4 "2006-03-21T23:36:49Z")

</div>

A fellow newbie writes…

In the words of the API:  
" Renders the content that will be returned to the browser as the  
response body… Action rendering is the most common form and the type  
used automatically by Action Controller when nothing else is specified.  
By default, actions are rendered within the current layout (if one  
exists)."

In this case it’s rendering the method ‘list’ in the current controller.

See:  
[http://api.rubyonrails.com/classes/ActionController/Base.html#M000178](http://api.rubyonrails.com/classes/ActionController/Base.html#M000178)  
for full details.

Hope this helps

CT

---

<div class="post-metadata">

**Author:** ![gonzalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@gonzalo](https://www.ruby-forum.com/u/gonzalo)\
**Post date:** [March 21, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/render-action-list/55533/5 "2006-03-21T23:45:32Z")

</div>

thanks a lot, again.
