# How to Action Controller

**URL:** <https://www.ruby-forum.com/t/how-to-action-controller/173860>\
**Category:** Rails\
**Created:** [August 17, 2009, 7:47am UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860 "2009-08-17T07:47:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgumbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bgumbiker](https://www.ruby-forum.com/u/bgumbiker)\
**Post date:** [August 17, 2009, 7:47am UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860/1 "2009-08-17T07:47:07Z")

</div>

Just starting my first project and wondering what is the proper design  
in terms of number of Controllers for simple static page having just  
following site layout: home | services | portfolio | about. Should I  
create one Controller for each? Or create action methods representing  
above layout in ApplicationController?  
Thanks,  
Bogumbiker

---

<div class="post-metadata">

**Author:** ![bgumbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bgumbiker](https://www.ruby-forum.com/u/bgumbiker)\
**Post date:** [August 17, 2009, 10:12am UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860/2 "2009-08-17T10:12:17Z")

</div>

If we’re talking about static pages that doesn’t need to be edited,  
take a look at High Voltage ([GitHub - thoughtbot/high\_voltage: Easily include static pages in your Rails app.](http://github.com/thoughtbot/high_voltage/)  
tree/master). If the pages needs to be edited, go ahead and watch Ryan  
B’s excellent screencast on semi-static pages:  
[#117 Semi-Static Pages - RailsCasts](http://railscasts.com/episodes/117-semi-static-pages)

---

<div class="post-metadata">

**Author:** ![bgumbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bgumbiker](https://www.ruby-forum.com/u/bgumbiker)\
**Post date:** [August 17, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860/3 "2009-08-17T14:56:10Z")

</div>

Hi,

```
  In such case I would create one controller, let's say site with

```

actions home (or index), services, portfolio and about. If the content  
is not dynamic, the code in the controller will be empty, the view  
will contain the static text. I do not see any reason for creating  
controller for these things. The links to the actions should be placed  
maybe in the ApplicationController layout if you want to have them on  
every page of your site.

bw, Georg

---

<div class="post-metadata">

**Author:** ![bgumbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bgumbiker](https://www.ruby-forum.com/u/bgumbiker)\
**Post date:** [August 18, 2009, 2:03am UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860/4 "2009-08-18T02:03:29Z")

</div>

Thanks a lot for this clarification.  
Indeed my site will be semi-static and i am ok to edit from time to  
time just the view.  
However the html/css is quite complex and wondering where to put all  
div and classes blocks + css for each of them.  
Should I put such code into partials?  
thanks,  
bogumil

---

<div class="post-metadata">

**Author:** ![bgumbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bgumbiker](https://www.ruby-forum.com/u/bgumbiker)\
**Post date:** [August 17, 2009, 4:50pm UTC](https://www.ruby-forum.com/t/how-to-action-controller/173860/5 "2009-08-17T16:50:12Z")

</div>

bgumbiker wrote:

> Just starting my first project and wondering what is the proper design  
> in terms of number of Controllers for simple static page having just  
> following site layout: home | services | portfolio | about. Should I  
> create one Controller for each? Or create action methods representing  
> above layout in ApplicationController?

If your site only has static pages (which seems to be the case) then  
don’t use Rails at all! Consider something like StaticMatic or perhaps  
a CMS.

> Thanks,  
> Bogumbiker

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
