Splitting controller

I'm trying to split controller into several files. I tried extracting methods into separate files and then requiring them in main controller, but this doesn't seem to work.

controllers/reports/sales_reports.rb: class ReportController < ApplicationController   def sales   end end

controllers/reports/purchases_reports.rb: class ReportController < ApplicationController   def purchases   end end

controllers/report_controller.rb: require 'reports/sales_reports' require 'reports/purchases_reports' class ReportController < ApplicationController end

This doesn't seem to work. What I'm doing wrong?

Warning: I'm a TOTAL Ruby/Rails beginner

Thank you, as always the solution was to read 'Programming Ruby' :slight_smile: You suggestion worked, the only error was that module names have to start with capital letter.