What''s the proper syntax for including a module in a controller? example: include SomeSystem class ApplicationController < ActionController::Base end does it go before or after the class definition ? and do I need some quotes around it ? TIA Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> What''s the proper syntax for including a module in a controller? > does it go before or after the class definition ?The controller _is_ the class. So any included module goes within the class definition.> and do I need some quotes around it ?You include a name, e.g. Foo. Foo would be a legal name, visible in your scope. So no, you don''t quote that, you are in fact passing Foo by reference (the name contains a reference). There are some special cases - e.g. ActionController.helper - where you would perform a sort of inclusion in which the module name would be quoted. But you asked about the basic Class.include form, so no. -Alder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
require_dependency "acl_system" class ApplicationController < ActionController::Base include ACLSystem model :user end ((taken from acl system on wiki.rubyonrails.com)) any good? -- 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 -~----------~----~----~----~------~----~------~--~---