# About views

**URL:** <https://www.ruby-forum.com/t/about-views/118507>\
**Category:** Rails\
**Created:** [October 27, 2007, 11:46pm UTC](https://www.ruby-forum.com/t/about-views/118507 "2007-10-27T23:46:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Post date:** [October 27, 2007, 11:46pm UTC](https://www.ruby-forum.com/t/about-views/118507/1 "2007-10-27T23:46:22Z")

</div>

Hi, everyone, I just want to know if I created a action in controller,  
I must have need one view for this action?  
except render :nothing=\>true.

---

<div class="post-metadata">

**Author:** ![OnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Post date:** [October 27, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/about-views/118507/2 "2007-10-27T23:55:43Z")

</div>

No, you don’t need a view for every action. Neither do you need an  
action for every view.

If you want to see this in action, just create a resource will  
scaffold\_resource generator. index, show, new, edit all have views  
while, create, update, and destroy do not. This is because the either  
redirect to another view, or render another action.

Also, lets say you have a controller called main, and in the main  
views folder, you had a file called index.rhtml. If the markup in  
index.rhtml is all static, then you don’t even need an action for  
index in the “main” controller.

---

<div class="post-metadata">

**Author:** ![OnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@OnRails](https://www.ruby-forum.com/u/OnRails)\
**Post date:** [October 28, 2007, 12:33am UTC](https://www.ruby-forum.com/t/about-views/118507/3 "2007-10-28T00:33:06Z")

</div>

> Also, lets say you have a controller called main, and in the main  
> views folder, you had a file called index.rhtml. If the markup in  
> index.rhtml is all static, then you don’t even need an action for  
> index in the “main” controller.  
> This view doesn’t need to be static either. It could use variables  
> defined in before filters, methods in helpers, etc. Not a big deal, just  
> a little clarification.

-Bill
