# Render syntax has me stumped

**URL:** <https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732>\
**Category:** Rails\
**Created:** [July 27, 2009, 7:40am UTC](https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732 "2009-07-27T07:40:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Rand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tim\_Rand](https://www.ruby-forum.com/u/Tim_Rand)\
**Post date:** [July 27, 2009, 7:40am UTC](https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732/1 "2009-07-27T07:40:26Z")

</div>

Hi,From within an action called manager within a controller called  
storedorders, I want to render to the view for the manger action of  
controller orders.

It really seems like the following syntax should work:

(within the StoredordersController manager method…)

```
respond_to do |format|
   format.html {render :controller => 'orders', :action => 

```

‘manager’}  
# format.xml { head :ok }  
end

But I get the following message:

“Template is missing  
Missing template storedorders/manager.erb in view path app/views”

Why is it even looking when I told it to render a different view?

This however works:  
respond\_to do |format|  
format.html {render ‘orders/manager’}  
# format.xml { head :ok }  
end

It really seems like either syntax should be valid. What am I missing?  
Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![Tim\_Rand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tim\_Rand](https://www.ruby-forum.com/u/Tim_Rand)\
**Post date:** [July 27, 2009, 7:54am UTC](https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732/2 "2009-07-27T07:54:29Z")

</div>

Argument to the “render()” method does not recognises the  
“:controller” key. You might be confusing it with arguments to  
“redirect\_to()” method.  
Checkout

> **[ActionController::Base](https://api.rubyonrails.org/classes/ActionController/Base.html#M000658)**
>
> 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 more information.

---

<div class="post-metadata">

**Author:** ![Tim\_Rand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tim\_Rand](https://www.ruby-forum.com/u/Tim_Rand)\
**Post date:** [July 27, 2009, 10:37am UTC](https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732/3 "2009-07-27T10:37:49Z")

</div>

Thanks for answering Vikrant,  
Did render change recently, because the internet is littered with  
advice saying

render :controller =\> ‘con\_name’, :action =\> ‘action\_name’

is valid syntax. And if you can say render ‘controller/action’, why  
not allow it to be stated the other way too?  
Tim

---

<div class="post-metadata">

**Author:** ![Tim\_Rand](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tim\_Rand](https://www.ruby-forum.com/u/Tim_Rand)\
**Post date:** [July 27, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/render-syntax-has-me-stumped/172732/4 "2009-07-27T18:17:21Z")

</div>

I don’t remember that “render()” ever worked that way. Can I have an  
example?
