How do you decide what controllers and actions to have?

I’m fairly new to RoR and am teaching myself by slowly converting one of
my sites (http://tutorialoutpost.com) to RoR from PHP. What I’m having
trouble with though is figuring out what controllers I should make and
what actions to use.

How do you plan all of it out? I’d had to start hacking away at this and
then come to find I had it all laid out wrong from the start.

Josh P. wrote:

I’m fairly new to RoR and am teaching myself by slowly converting one of
my sites (http://tutorialoutpost.com) to RoR from PHP. What I’m having
trouble with though is figuring out what controllers I should make and
what actions to use.

How do you plan all of it out? I’d had to start hacking away at this and
then come to find I had it all laid out wrong from the start.

The best way would be to see into what categories your data naturally
falls.

For example, if you’re designing a blog, you might have controllers (and
most likely models) for entries, comments, and users, at the very least.
Also possibly tags or comments. Those would be represented by schemas
in your database, so they’d be models, to encapsulate the data, and
controllers, to handle the logic. If you have a variety of ways to
display your archive listings you might have an archives controller.

I got a blank page when I clicked on your site, but if it’s a site with
a lot of tutorials, then you might have something similar: a model and
controller for the individual tutorial entries, for your users, for
comments or categories, or possibly for a listing of code examples.

On a shop site (like the Depot example in the excellent Agile Web
Development with Rails), you’d have a controller for users, and for
items to be sold, and to handle the administrative tasks of listing
items for sale.

Hope this helps,
Jeff C.man