Hi, I am not sure how to extend Rails. I want to write a class where I can Access my Models, like "User.all". I tried to add a class in the lib/ folder but then ruby complains that e.g. "User.all" with "NameError: uninitialized constant " Is there a way to inherit my Rails functionality in a ruby class in the /lib folder? Or am I going in the conplete wrong direction? Thanks and all the best! -- 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.
keyword require missing? On Sat, Feb 20, 2010 at 5:28 PM, phil <philipp.knobelspies-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am not sure how to extend Rails. I want to write a class where I can > Access my Models, like "User.all". > > I tried to add a class in the lib/ folder but then ruby complains that > e.g. "User.all" with "NameError: uninitialized constant " > > Is there a way to inherit my Rails functionality in a ruby class in > the /lib folder? Or am I going in the conplete wrong direction? > > > Thanks and all the best! > > -- > 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. > >-- 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.
Hi Thanks for your answer, turned out the Problem was that I did not have the gems in the right path! On Feb 20, 11:51 pm, tom <tomabr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> keyword require missing? > > On Sat, Feb 20, 2010 at 5:28 PM,phil<philipp.knobelsp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > > I am not sure how to extend Rails. I want to write a class where I can > > Access my Models, like "User.all". > > > I tried to add a class in the lib/ folder but then ruby complains that > > e.g. "User.all" with "NameError: uninitialized constant " > > > Is there a way to inherit my Rails functionality in a ruby class in > > the /lib folder? Or am I going in the conplete wrong direction? > > > Thanks and all the best! > > > -- > > 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 athttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.