Although it may not seem intuitive, Rails is very picky when it comes to how you name your files, specifically when adding new classes within your app folder.
Let’s say you have a class that looks like this:
class MySuperCatHelper def meow puts "Meow!!" end end
You’ve saved this class in the app/helpers directory in a file called my_supercat_helper.rb. Naturally, you want this class to be available to your MySuperCat controller where you wish to add the following code:
cat = MySuperCatHelper.new cat.meow
But for some reason, you’re getting an error about an uninitialized constant when using the above code in your MySuperCat controller.
Why is that?