Maximus S
Maximus S

Reputation: 11095

Rails 3] About Requiring a Gem

A Simple Question: When do you have to put 'require gem_name' into a controller? As I've explored quite a few gems, some of them make me put 'require' and others don't. I need some clarification. Are all those instructions that tell me to require a gem outdated?

Could you confirm: having gem gem_name in the Gemfile and running bundle install is all I need to do for all gems, and placing require gem_name isn't necessary.

Upvotes: 0

Views: 54

Answers (1)

DaveJohnston
DaveJohnston

Reputation: 10151

If you are adding your required Gems to the Gemfile and running bundle install, then you shouldn't add require gem_name to the controller file, the Gem will be available for you.

Upvotes: 1

Related Questions