Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails - Controller Subdirectory

Tags:

I am somewhat new to RoR,

I want to have a structured directory, because project may become big I don't want to have all controllers directly into controllers directory.

I would want something as

app/
    controllers/
          application_controller.rb
          groupa/
                athing_controller.rb
                athing2_controller.rb
          groupb/
                bthing_controller.rb

However when I place in the routes.rb the following:

get 'athing', :to => "groupa/athing#index"

I get the following error on localhost:3000/athing/ :

superclass mismatch for class AthingController

Which is like:

class AthingController < ApplicationController
  def index
  end
end

Am I missing something? Can I place subdirectories at all?