Trying to keep things organized I created a directory under app called modules. In my env file I did what I did for my other directories: config.load_paths += Dir[ "#{RAILS_ROOT}/app/modules/**" ] Here is the top of my module: module Sanitize module Html def self.included(base) base.extend(ClassMethods) end I have an initializer that does this: include HtmlSanitize When I boot up it says unitilialized constant "HtmlSanitize" What am I missing? -- 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.
On Mar 31, 8:20 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Trying to keep things organized I created a directory under app called > modules. In my env file I did what I did for my other directories: > > config.load_paths += Dir[ "#{RAILS_ROOT}/app/modules/**" ] > > Here is the top of my module: > > module Sanitize > module Html > def self.included(base) > base.extend(ClassMethods) > end > > I have an initializer that does this: > include HtmlSanitize > > When I boot up it says unitilialized constant "HtmlSanitize" >You don''t have a module called HtmlSanitise ( you do have Sanitize::Html but that''s completely different) Fred> What am I missing?-- 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.
Fred, do the initializer files get called before the environment.rb on boot? On Wed, Mar 31, 2010 at 3:32 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Mar 31, 8:20 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Trying to keep things organized I created a directory under app called > > modules. In my env file I did what I did for my other directories: > > > > config.load_paths += Dir[ "#{RAILS_ROOT}/app/modules/**" ] > > > > Here is the top of my module: > > > > module Sanitize > > module Html > > def self.included(base) > > base.extend(ClassMethods) > > end > > > > I have an initializer that does this: > > include HtmlSanitize > > > > When I boot up it says unitilialized constant "HtmlSanitize" > > > You don''t have a module called HtmlSanitise ( you do have > Sanitize::Html but that''s completely different) > > Fred > > What am I missing? > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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.