Hey all Is it possible to create mixins for common functionality that can be mixed in with other helpers? I know somone will probally say stick it in the application helper, but i dont want to include it globally, only in 2 helpers... Any ideas? Cheers Tim -- 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 -~----------~----~----~----~------~----~------~--~---
Sure, you can mix-in other mixins. For example: app/helpers/ - login_helper.rb - emp_login_helper.rb - admin_login_helper.rb emp_login_helper.rb: require ''login_helper'' module EmpLoginHelper include LoginHelper end admin_login_helper.rb: module AdminLoginHelper include LoginHelper end Is that what you''re asking about? Jason On 10/3/06, Tim Perrett <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hey all > > Is it possible to create mixins for common functionality that can be > mixed in with other helpers? > > I know somone will probally say stick it in the application helper, but > i dont want to include it globally, only in 2 helpers... > > Any ideas? > > Cheers > > Tim > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Ahh yes, i didnt realise you could use include, i had just been trying require on its own! lol Many thanks Tim -- 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 -~----------~----~----~----~------~----~------~--~---