Hi All, I want to know what the best to manage multiple models in one controller is. I have a series of tables that simply manage geogrophical ids, topic ids, type ids, etc.... and I''d like to manage them all from one controller. What''s the best way to accomplish this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Josh Stephenson wrote:> Hi All, > > I want to know what the best to manage multiple models in one > controller is. I have a series of tables that simply manage > geogrophical ids, topic ids, type ids, etc.... and I''d like to manage > them all from one controller. > > What''s the best way to accomplish this?Controller''s don''t have to be bound to any specific model. Simply create actions that manipulate other models. There is no constraint that says one controller has to manipulate only one model. Also, you may want to look into modularized controllers. This lets you create groups of controllers. That may or may not be what you want. -- 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 -~----------~----~----~----~------~----~------~--~---
petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-02 15:57 UTC
Re: Multiple models for one controller
Josh Stephenson wrote:> Hi All, > > I want to know what the best to manage multiple models in one > controller is. I have a series of tables that simply manage > geogrophical ids, topic ids, type ids, etc.... and I''d like to manage > them all from one controller.Why do you want to use only one controller? Is it because the code in each controller is so similar and you want to stay DRY? There are better ways than using just one controller. You could have a controller hierarchy using OOP inheritance, you could use your own scaffolding metaprogramming, or you could write a module and mix it into your controllers. Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---