Forum: Ruby on Rails Question concerning restful controller organisation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A7a7dddca32cd8b6e5af394c500934d5?d=identicon&s=25 rv dh (ralph)
on 2007-02-21 17:53

I am currently writing a new rails application and am somewhat confused
about how to organize controllers and actions the restful way.

While writing the backend, everything was clear to me. I've used
resource scaffolding most of the time, so my controllers do look very
restful right now. Backend actions should only be available to
registered administrators.

So the difficult part is the frontend:

Let's assume I have a model called "Rabbit". I do have the CRUD-actions
(index, show, new, edit, create, update, destroy) in the backend.
Frontend users should only be able to see rabbits, so I could open up
the show and index actions to them. But the backend and the frontend do
use different layouts. Switching layouts depending on the login status
is also bad, because backend admins should be able to use the frontend
in the same way unregistered users do.

So, what are your recommendations for organizing backend and frontend
actions and controllers? Create a separate controller for the frontend
actions? Create separate actions for show and index in the same
controller? Anything else I may have overlooked?

Any help is appreciated.
Eec43f946d65be32e6b9fd2b3a1582a5?d=identicon&s=25 Adam Groves (addywaddy)
on 2007-02-21 22:53
Hi Ralph,

Have a read through RESTful Rails Development (English Version) at:


A7a7dddca32cd8b6e5af394c500934d5?d=identicon&s=25 rv dh (ralph)
on 2007-02-22 11:00
Hello Adam,

I know this tutorial, but it just generally describes how to develop
restful applications, not how to cleanly separate backend and frontend

Adam Groves wrote:
> Hi Ralph,
> Have a read through RESTful Rails Development (English Version) at:
> Regards
> Adam
This topic is locked and can not be replied to.