# "Create" form in another Controller's "show" view

**URL:** <https://www.ruby-forum.com/t/create-form-in-another-controllers-show-view/182723>\
**Category:** Rails\
**Created:** [February 1, 2010, 11:31pm UTC](https://www.ruby-forum.com/t/create-form-in-another-controllers-show-view/182723 "2010-02-01T23:31:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [February 1, 2010, 11:31pm UTC](https://www.ruby-forum.com/t/create-form-in-another-controllers-show-view/182723/1 "2010-02-01T23:31:49Z")

</div>

This seems like a really obvious question, but I’m blanking on the  
solution. I have a simple post/comments relationship that fits the  
basic blog model. That means that the form to create a new comment is  
in the show action in the Posts controller, but the form links to the  
create action in the Comments controller. My question is basically: is  
this the best way to model that relationship? The problem I’m running  
into is that when posting a comment fails due to missing fields, you  
can’t easily “render :action =\> ‘new’” to retain the values while  
displaying an error message.

What am I missing?

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [February 1, 2010, 11:54pm UTC](https://www.ruby-forum.com/t/create-form-in-another-controllers-show-view/182723/2 "2010-02-01T23:54:21Z")

</div>

The problem is that you cant render another controllers action the  
traditional way. In the comments controller you have to render :template  
=\> ‘posts/show’ when a comment fails validation.

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [February 2, 2010, 12:18am UTC](https://www.ruby-forum.com/t/create-form-in-another-controllers-show-view/182723/3 "2010-02-02T00:18:03Z")

</div>

Thank you. 🙂
