Hi, I have two plugins with rails active-rbac and actionflow. Actionflow uses his own controller, so I have two super controllers one for the application (ApplicationController) and one for actionflow (FlowApplicationController with base ActionFlow::Base). Now I want to use functionality in both controllers like authorization en authentication. What is the best way to such a thing, must I build a class a module, etc. And are there examples with a solution for my problem. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 9 Dec 2007, at 10:09, Erwin wrote:> > Hi, > > I have two plugins with rails active-rbac and actionflow. Actionflow > uses his own controller, so I have two super controllers one for the > application (ApplicationController) and one for actionflow > (FlowApplicationController with base ActionFlow::Base). Now I want to > use functionality in both controllers like authorization en > authentication. What is the best way to such a thing, must I build a > class a module, etc. And are there examples with a solution for my > problem.If you are asking whether a module is a good way to go for sharing some code (eg before_filters for authentication, logging etc...) between controllers, then yes, that will work. 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your reply. So I''ll put the code in a seperate module. Is there some example how to do this? Erwin On 9 dec, 15:33, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 9 Dec 2007, at 10:09, Erwin wrote: > > > > > Hi, > > > I have two plugins with rails active-rbac and actionflow. Actionflow > > uses his own controller, so I have two super controllers one for the > > application (ApplicationController) and one for actionflow > > (FlowApplicationController with base ActionFlow::Base). Now I want to > > use functionality in both controllers like authorization en > > authentication. What is the best way to such a thing, must I build a > > class a module, etc. And are there examples with a solution for my > > problem. > > If you are asking whether a module is a good way to go for sharing > some code (eg before_filters for authentication, logging etc...) > between controllers, then yes, that will work. > > 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 9 Dec 2007, at 22:11, Erwin wrote:> > Thanks for your reply. So I''ll put the code in a seperate module. Is > there some example how to do this? >don''t know about that. There''s not really much to explain - you just do it. Fred> Erwin > > On 9 dec, 15:33, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On 9 Dec 2007, at 10:09, Erwin wrote: >> >> >> >>> Hi, >> >>> I have two plugins with rails active-rbac and actionflow. Actionflow >>> uses his own controller, so I have two super controllers one for the >>> application (ApplicationController) and one for actionflow >>> (FlowApplicationController with base ActionFlow::Base). Now I want >>> to >>> use functionality in both controllers like authorization en >>> authentication. What is the best way to such a thing, must I build a >>> class a module, etc. And are there examples with a solution for my >>> problem. >> >> If you are asking whether a module is a good way to go for sharing >> some code (eg before_filters for authentication, logging etc...) >> between controllers, then yes, that will work. >> >> 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 -~----------~----~----~----~------~----~------~--~---