Hi! I have a controller and I want to use the functionality of another controller ignoring its rendered response. Is that possible? What the render_component is for? Regards, Mohsin --~--~---------~--~----~------------~-------~--~----~ 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 21 Feb 2008, at 11:21, MohsinHijazee wrote:> > Hi! > I have a controller and I want to use the functionality of another > controller ignoring its rendered response. Is that possible? > What the render_component is for?render component is dead. don''t use it. Sounds like you want a module containing the common functionality that you can include in both places Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
would you be more specific in what are you trying to archieve. what functionality? On 21 фев, 13:21, MohsinHijazee <mohsinhija...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > I have a controller and I want to use the functionality of another > controller ignoring its rendered response. Is that possible? > What the render_component is for? > > Regards, > Mohsin--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here is the situation: I have functionality in two controllers. Controller A deletes the customers totally and the B simply unlinks them from a group. The logic of both the operations is quit complex and we cannot afford any modifications for now neither we can replicate the code because it is covered by tests and this coverage is vital for the survival of the project. I derive the C Controller from A so I get the ability to delete the customers for free but I want this controller be able to call the function unlink_customer based on the incoming parmeters from the C_Controller#destroy. How can I do that? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Here is the situation: I have functionality in two controllers. Controller A deletes the customers totally and the B simply unlinks them from a group. The logic of both the operations is quit complex and we cannot afford any modifications for now neither we can replicate the code because it is covered by tests and this coverage is vital for the survival of the project. I derive the C Controller from A so I get the ability to delete the customers for free but I want this controller be able to call the function B_Controller#unlink_customer based on the incoming parameters from the C_Controller#destroy. How can I do that? --~--~---------~--~----~------------~-------~--~----~ 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 21 Feb 2008, at 12:17, MohsinHijazee wrote:> > Here is the situation: > > I have functionality in two controllers. Controller A deletes the > customers totally and the B simply unlinks them from a group. The > logic of both the operations is quit complex and we cannot afford any > modifications for now neither we can replicate the code because it is > covered by tests and this coverage is vital for the survival of the > project. > > I derive the C Controller from A so I get the ability to delete the > customers for free but I want this controller be able to call the > function unlink_customer based on the incoming parmeters from the > C_Controller#destroy. How can I do that?Sounds like none of this code should be in the controllers at all, and should be in the Customer model, at which point the problem goes away. Fred --~--~---------~--~----~------------~-------~--~----~ 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 Feb 21, 6:43 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 21 Feb 2008, at 12:17, MohsinHijazee wrote: > > > > > Here is the situation: > > > I have functionality in two controllers. Controller A deletes the > > customers totally and the B simply unlinks them from a group. The > > logic of both the operations is quit complex and we cannot afford any > > modifications for now neither we can replicate the code because it is > > covered by tests and this coverage is vital for the survival of the > > project. > > > I derive the C Controller from A so I get the ability to delete the > > customers for free but I want this controller be able to call the > > function unlink_customer based on the incoming parmeters from the > > C_Controller#destroy. How can I do that? > > Sounds like none of this code should be in the controllers at all, and > should be in the Customer model, at which point the problem goes away.But even if it is this way then? Any way around?> > Fred--~--~---------~--~----~------------~-------~--~----~ 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 21 Feb 2008, at 14:33, MohsinHijazee wrote:> > > > On Feb 21, 6:43 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 21 Feb 2008, at 12:17, MohsinHijazee wrote: >> >> >> >>> Here is the situation: >> >>> I have functionality in two controllers. Controller A deletes the >>> customers totally and the B simply unlinks them from a group. The >>> logic of both the operations is quit complex and we cannot afford >>> any >>> modifications for now neither we can replicate the code because it >>> is >>> covered by tests and this coverage is vital for the survival of the >>> project. >> >>> I derive the C Controller from A so I get the ability to delete the >>> customers for free but I want this controller be able to call the >>> function unlink_customer based on the incoming parmeters from the >>> C_Controller#destroy. How can I do that? >> >> Sounds like none of this code should be in the controllers at all, >> and >> should be in the Customer model, at which point the problem goes >> away. > But even if it is this way then? Any way around?Sticking the code in a module that you include in both controllers should do the job, but having that much logic in the controllers is really bad design. I wouldn''t have thought just moving the code into the customer model would be very complicated (and if you have good test coverage then such changes are usually less risky) Fred> >> >> Fred > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 21, 8:31 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 21 Feb 2008, at 14:33, MohsinHijazee wrote: > > > > > > > On Feb 21, 6:43 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > >> On 21 Feb 2008, at 12:17, MohsinHijazee wrote: > > >>> Here is the situation: > > >>> I have functionality in two controllers. Controller A deletes the > >>> customers totally and the B simply unlinks them from a group. The > >>> logic of both the operations is quit complex and we cannot afford > >>> any > >>> modifications for now neither we can replicate the code because it > >>> is > >>> covered by tests and this coverage is vital for the survival of the > >>> project. > > >>> I derive the C Controller from A so I get the ability to delete the > >>> customers for free but I want this controller be able to call the > >>> function unlink_customer based on the incoming parmeters from the > >>> C_Controller#destroy. How can I do that? > > >> Sounds like none of this code should be in the controllers at all, > >> and > >> should be in the Customer model, at which point the problem goes > >> away. > > But even if it is this way then? Any way around? > > Sticking the code in a module that you include in both controllers > should do the job, but having that much logic in the controllers is > really bad design. I wouldn''t have thought just moving the code into > the customer model would be very complicated (and if you have good > test coverage then such changes are usually less risky) > > Fred >But what if I do a stunt of emulating that the call comes from a remote machine? The same process rails takes while executing an action?> > > >> Fred--~--~---------~--~----~------------~-------~--~----~ 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 22 Feb 2008, at 12:21, MohsinHijazee wrote:> > > > On Feb 21, 8:31 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 21 Feb 2008, at 14:33, MohsinHijazee wrote: >> >> >>>>> >> >>>> Sounds like none of this code should be in the controllers at all, >>>> and >>>> should be in the Customer model, at which point the problem goes >>>> away. >>> But even if it is this way then? Any way around? >> >> Sticking the code in a module that you include in both controllers >> should do the job, but having that much logic in the controllers is >> really bad design. I wouldn''t have thought just moving the code into >> the customer model would be very complicated (and if you have good >> test coverage then such changes are usually less risky) >> >> Fred >> > But what if I do a stunt of emulating that the call comes from a > remote machine? The same process rails takes while executing an > action?If you''re prepared to do something that horrible i really don''t understand your reticence to make a simple code change. Plus if you hit the same mongrel you could deadlock. Fred.> >> >> >>>> Fred > >--~--~---------~--~----~------------~-------~--~----~ 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 Feb 22, 5:28 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 22 Feb 2008, at 12:21, MohsinHijazee wrote: > > > > > > > On Feb 21, 8:31 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > >> On 21 Feb 2008, at 14:33, MohsinHijazee wrote: > > >>>> Sounds like none of this code should be in the controllers at all, > >>>> and > >>>> should be in the Customer model, at which point the problem goes > >>>> away. > >>> But even if it is this way then? Any way around? > > >> Sticking the code in a module that you include in both controllers > >> should do the job, but having that much logic in the controllers is > >> really bad design. I wouldn''t have thought just moving the code into > >> the customer model would be very complicated (and if you have good > >> test coverage then such changes are usually less risky) > > >> Fred > > > But what if I do a stunt of emulating that the call comes from a > > remote machine? The same process rails takes while executing an > > action? > > If you''re prepared to do something that horrible i really don''t > understand your reticence to make a simple code change. Plus if you > hit the same mongrel you could deadlock. >This is because of the test coverage and I do not understand the fixtures data yet.> Fred. > > > > >>>> Fred--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---