Hi, So I have an application in rails. The purpose of the application is to display test results written to the database. Each test consists of several defined operations. Each operation can have multiple sub operations (witch results in a tree like structure). Some of the defined operations have to be displayed in a uniq way and some have a default view. Also Most of the tests have some uniq summary. So the main way to display the test is to display the operations that where used in it. In a first view only the root operations are displayed. And if a user is interested in the operation he can click on it expanding it. So my current version of the application reads the root operations associated with a test. Based on a operation definition there is a big case statement witch is used to map operation to a specific shared view. This is done via partial renders witch update parts of the page via ajax. So on one html page I have different parts of it (operations) controlled by different view''s (but not controllers – there is only one controller). The logic to each operation is added via helpers. So this actual works but... I don''t like the solution because all the application logic is located in helpers and shared partial view''s. As I understand rails concept is to put the application logic into controllers. But I don''t know how to use multiple controllers to create one page (each controller has to have control of a part of a page). I''m looking for a way to design the application in a more scalable way because my solution is a little messy.. ;). Any ideas would be 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-/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.
You can use MVC paradigm to your application interface, too. As you describe it, It sounds that is the client side which must handle the logic; well, design it using MVC. This article from A List Apart may be useful: http://www.alistapart.com/articles/javascript-mvc/ On 28 ene, 20:43, Grzegorz Lysko <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > So I have an application in rails. The purpose of the application is to > display test results written to the database. Each test consists of > several defined operations. Each operation can have multiple sub > operations (witch results in a tree like structure). Some of the defined > operations have to be displayed in a uniq way and some have a default > view. Also Most of the tests have some uniq summary. > So the main way to display the test is to display the operations that > where used in it. In a first view only the root operations are > displayed. And if a user is interested in the operation he can click on > it expanding it. > So my current version of the application reads the root operations > associated with a test. Based on a operation definition there is a big > case statement witch is used to map operation to a specific shared view. > This is done via partial renders witch update parts of the page via > ajax. So on one html page I have different parts of it (operations) > controlled by different view''s (but not controllers – there is only one > controller). The logic to each operation is added via helpers. > > So this actual works but... I don''t like the solution because all the > application logic is located in helpers and shared partial view''s. As I > understand rails concept is to put the application logic into > controllers. But I don''t know how to use multiple controllers to create > one page (each controller has to have control of a part of a page). I''m > looking for a way to design the application in a more scalable way > because my solution is a little messy.. ;). > Any ideas would be appreciated. > -- > Posted viahttp://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-/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.
Marnen Laibow-Koser
2010-Jan-29 13:18 UTC
Re: Generating one page with multiple controllers
Grzegorz Lysko wrote: [...]> As I > understand rails concept is to put the application logic into > controllers.Not really. Most of the logic should go in the models. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/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.