hooleyhoop
hooleyhoop

Reputation: 9198

Organising Rails source files

If i want to move /lib/foo_bar.rb to /lib/tidy/foo_bar.rb or even /lib/tidy/somestuff/foo_bar.rb

must i declare FooBar to be module Tidy or module Tidy::Somestuff

in other words must the modules match the directory structure?

Upvotes: 2

Views: 49

Answers (1)

Brendon McLean
Brendon McLean

Reputation: 416

Yes, if you don't want to specify the load path. You can add lib/tidy to the LOAD_PATH and then Rails will find it, but it's easier to just stick with the conventions

Upvotes: 2

Related Questions