How to Action Controller

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

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

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

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

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
[email protected]