Require statements?


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

require ‘lib’


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”

Ok, I’ll put it in the controller, unless someone tells me it’s bad
style :slight_smile:


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs