Ralph Von der heyden
2007-Feb-21 16:53 UTC
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Ralph, Have a read through RESTful Rails Development (English Version) at: http://www.b-simple.de/documents Regards Adam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Groves wrote:> Hi Ralph, > > > Have a read through RESTful Rails Development (English Version) at: > > http://www.b-simple.de/documents > > Regards > > Adam-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---