I just completed an exercise of breaking down an existing project and mapping out the controllers and actions, then re-factoring them into some perhaps more RESTful. Though I could be wrong since I am still grasping REST. Most of the controllers mapped perfectly into a REST structure, except for a few. I have Messages, which can respond to all the usual actions, plus a few more. The extras are Assign, Transfer, Escalate and Redirect. My inclination is to simply add the actions to the Message controller, then map the resources as needed. Is that the best practice? -- 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 -~----------~----~----~----~------~----~------~--~---
On May 21, 10:19 pm, Lon Baker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I just completed an exercise of breaking down an existing project and > mapping out the controllers and actions, then re-factoring them into > some perhaps more RESTful. Though I could be wrong since I am still > grasping REST. > > Most of the controllers mapped perfectly into a REST structure, except > for a few. > > I have Messages, which can respond to all the usual actions, plus a few > more. The extras are Assign, Transfer, Escalate and Redirect. > > My inclination is to simply add the actions to the Message controller, > then map the resources as needed. > > Is that the best practice? > > -- > Posted viahttp://www.ruby-forum.com/.I found this video really great: http://www.scribemedia.org/2006/07/09/dhh/ In there he says that roughly, not everything will map and don''t force it. But before he says that he gives two examples where he needed to rethink his objects and CRUD. For example, with your assign. What are you assigning? Are you, instead, actually creating a relationship between two objects. If so, then use CRUD (and REST) to create and manage the relationship. Also, it sounds like Transfer, Escalate, and Redirect are actually just special cases of update. But, the main thing I took away from that video is a philosophy of not forcing anything. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
pedz wrote:> On May 21, 10:19 pm, Lon Baker <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > I found this video really great: > > http://www.scribemedia.org/2006/07/09/dhh/ > > In there he says that roughly, not everything will map and don''t force > it. But before he says that he gives two examples where he needed to > rethink his objects and CRUD.Thanks. Listening to that talk did help clarify a few my my assumptions. -- 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 -~----------~----~----~----~------~----~------~--~---