Rails n00b question. I am creating a plain old Ruby object in Rails. But I am not sure if there is a standard location in the app that I should put this object.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Several choices, but the
libdirectory is the most common.If you need to initialize the code, the most common place is
config/initializers.So you might have:
and:
contains your ruby code.
contains code that initializes your stuff, whatever Ruby files that are found in
config/initializersare run when Rails boots up.