Hi, In my environment.rb file I ''require'' some files. They seem to be available to all my .rb files and my application.rhtml, but not to my other .rhtml files. Is this an understanding error on my part? If not, what''s the best way of making the files accessible to my .rthml files? Thanks -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Stone
2007-Feb-14 00:28 UTC
Re: something ''required'' in environment.rb available to all?
On 2/13/07, Farhad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi, > > In my environment.rb file I ''require'' some files. They seem to be > available to all my .rb files and my application.rhtml, but not to my > other .rhtml files. Is this an understanding error on my part? If not, > what''s the best way of making the files accessible to my .rthml files? > > > Thanks > > -- > Posted via http://www.ruby-forum.com/. > > > >Add include statements into your application_helper.rb to give access to modules/classes that you have required in your environment.rb. -- Andrew Stone --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Farhad
2007-Feb-14 00:36 UTC
Re: something ''required'' in environment.rb available to all?
Thanks Andrew, Aren''t the include statements just so that you can merge the namespaces? Shouldn''t I just be able to do something like: RequiredModule::Constant to access that constant for the module that was required? In any case, I have added the "include RequiredModule" in my caller_helper.rb class, and I still can''t access the constant. Andrew Stone wrote:> On 2/13/07, Farhad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> Thanks >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > Add include statements into your application_helper.rb to give access to > modules/classes that you have required in your environment.rb. > > > > -- > Andrew Stone-- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Farhad
2007-Feb-14 00:43 UTC
Re: something ''required'' in environment.rb available to all?
OK - pilot error. Problem is that I had added the constant and not re-set the server. The server only sources the files once if they''re done in environment.rb. Farhad wrote:> Thanks Andrew, > > Aren''t the include statements just so that you can merge the namespaces? > Shouldn''t I just be able to do something like: RequiredModule::Constant > to access that constant for the module that was required? > > In any case, I have added the "include RequiredModule" in my > caller_helper.rb class, and I still can''t access the constant. > > Andrew Stone wrote: >> On 2/13/07, Farhad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >>> Thanks >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >>> > >>> >> Add include statements into your application_helper.rb to give access to >> modules/classes that you have required in your environment.rb. >> >> >> >> -- >> Andrew Stone-- 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?hl=en -~----------~----~----~----~------~----~------~--~---