# rendering and action controller in a view

**URL:** <https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351>\
**Category:** rubyonrails-talk\
**Created:** [April 22, 2008, 4:55am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351 "2008-04-22T04:55:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Beckwith](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@David\_Beckwith](https://discuss.rubyonrails.org/u/David_Beckwith)\
**Post date:** [April 22, 2008, 4:55am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351/1 "2008-04-22T04:55:23Z")

</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:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 22, 2008, 6:22am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351/2 "2008-04-22T06:22:52Z")

</div>

David Beckwith: 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\_Beckwith](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@David\_Beckwith](https://discuss.rubyonrails.org/u/David_Beckwith)\
**Post date:** [April 22, 2008, 7:45am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351/3 "2008-04-22T07:45:52Z")

</div>

I tried

\<%= render :template =\> "../things/edit" %\>

But that didn't seem to do anything....

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 22, 2008, 8:21am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351/4 "2008-04-22T08:21:05Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Phlip](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Phlip](https://discuss.rubyonrails.org/u/Phlip)\
**Post date:** [April 22, 2008, 11:08am UTC](https://discuss.rubyonrails.org/t/rendering-and-action-controller-in-a-view/28351/5 "2008-04-22T11:08:11Z")

</div>

David Beckwith 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...
