# Rendering and action controller in a view

**URL:** <https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435>\
**Category:** Rails\
**Created:** [April 22, 2008, 6:55am UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435 "2008-04-22T06:55:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 22, 2008, 6:55am UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435/1 "2008-04-22T06:55:52Z")

</div>

Hi,  
If I’m in the view of users\_controller’s index action  
(index.html.erb).

Can I do something like this?

\<%= render :layout=\>false, :controller =\> ‘favorites’, :action  
=\> :show, :id =\> 1 %\>

That would be awesome.

Thank you,  
David 🙂

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 22, 2008, 8:22am UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435/2 "2008-04-22T08:22:52Z")

</div>

David B.:  
Check this out :

> **[Types of Render in Rails](http://teapoci.blogspot.com/2008/04/types-of-render-in-rails.html)**
>
> There's many render types that we can use for our view. Rails Render is a strong method that helps you to render your web pages. It comes wi...

Cheer,  
Reinhart

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 22, 2008, 9:46am UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435/3 "2008-04-22T09:46:45Z")

</div>

I tried

\<%= render :template =\> “…/things/edit” %\>

But that didn’t seem to do anything…

On Apr 21, 11:22 pm, Visit Indonesia 2008 \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 22, 2008, 10:21am UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435/4 "2008-04-22T10:21:05Z")

</div>

TRY IT  
\<%= render :template =\> “things/edit” %\>

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [April 22, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/rendering-and-action-controller-in-a-view/135435/5 "2008-04-22T13:11:17Z")

</div>

David B. wrote:

> \<%= render :layout=\>false, :controller =\> ‘favorites’, :action  
> =\> :show, :id =\> 1 %\>

What’s wrong with render :partial =\> ‘show’, where the show action calls  
a page  
that renders the same partial?

If both actions require the same controller setup code, put it in a  
helper…

–  
Phlip
