Hi, I am a newbie in rails. I am creating a rails app where I query an existing database consisting of multiple tables. I created a model file corresponding to each database in the model folder. Now the problem is I want a consolidated view for all the models. My app will basically take some inputs from user and generate a summarized view based on the given inputs by querying multiple tables (and thus interacting with many models). So shall i create just one controller and put the entire logic in it?? or can i transfer some logic to helpers? What would be the ideal design in this case? Any help is really appreciated!! Thanks & Regards, Shalini Sah -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/YiqMMBVkOmQJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 June 2012 15:03, Shalini Sah <shalinisah6692-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am a newbie in rails. I am creating a rails app where I query an existing > database consisting of multiple tables. I created a model file corresponding > to each database in the model folder. Now the problem is I want a > consolidated view for all the models. My app will basically take some inputs > from user and generate a summarized view based on theĀ given inputs by > querying multiple tables (and thus interacting with many models). So shall i > create just one controller and put the entire logic in it?? or can i > transfer some logic to helpers? What would be the ideal design in this case?There should be very little logic in the controller, but logic in the controller is usually best moved to the models. Helpers can be used to remove logic from the view. Can you give an example of the sort of logic you are talking about? Colin> > Any help is really appreciated!! > > Thanks & Regards, > Shalini Sah > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/YiqMMBVkOmQJ. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, 20 Jun 2012 07:03:43 -0700 (PDT) Shalini Sah <shalinisah6692-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am a newbie in rails. I am creating a rails app where I query an > existing database consisting of multiple tables. I created a model > file corresponding to each database in the model folder. Now the > problem is I want a consolidated view for all the models. My app will > basically take some inputs from user and generate a summarized view > based on the given inputs by querying multiple tables (and thus > interacting with many models). So shall i create just one controller > and put the entire logic in it?? or can i transfer some logic to > helpers? What would be the ideal design in this case?I think you need a separate model that will aggregate data from others. -- Sincerely yours, Aleksey V. Zapparov A.K.A. ixti FSF Member #7118 Mobile Phone: +34 677 990 688 Homepage: http://www.ixti.net JID: zapparov-962d5TIgE1qHXe+LvDLADg@public.gmane.org *Origin: Happy Hacking!