Hi- Where do you put your ''require'' statements in a rails app? For example, if I want to include a different gem, where do I place this? require ''lib'' Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Put it where you''re using it? If you need it in a paricular controller (which is hopefully where you need it... hate to see it in a model), then just call it there. You can require anywhere... but the best practices I don''t know about. class AvatarController > etc require "RMagick" #etc end On Jan 30, 2:28 pm, pete <peterbattag...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi- > > Where do you put your ''require'' statements in a rails app? > > For example, if I want to include a different gem, where do I place > this? > > require ''lib'' > > Thanks!--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ok, I''ll put it in the controller, unless someone tells me it''s bad style :) Thanks! On Jan 30, 8:37 pm, kopf1988 <kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Put it where you''re using it? If you need it in a paricular controller > (which is hopefully where you need it... hate to see it in a model), > then just call it there. You can require anywhere... but the best > practices I don''t know about. > > class AvatarController > etc > require "RMagick" > #etc > end > > On Jan 30, 2:28 pm, pete <peterbattag...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi- > > > Where do you put your ''require'' statements in a rails app? > > > For example, if I want to include a different gem, where do I place > > this? > > > require ''lib'' > > > Thanks!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---