Question concerning restful controller organisation

Hello,

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.

Hi Ralph,

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

http://www.b-simple.de/documents

Regards

Adam

Hello Adam,

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

Adam G. wrote:

Hi Ralph,

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

http://www.b-simple.de/documents

Regards

Adam

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs