Skip to content

Instantly share code, notes, and snippets.

@araslanov-e
Created August 1, 2013 10:27
Show Gist options
  • Save araslanov-e/6130213 to your computer and use it in GitHub Desktop.
Save araslanov-e/6130213 to your computer and use it in GitHub Desktop.
Dashboard::DashboardController.ancestors => [Dashboard::DashboardController, Dashboard::ApplicationController, ApplicationController, ... ] Member::MemberController.ancestors => [Member::MemberController, ApplicationController, ... ]
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
protect_from_forgery
end
# app/controllers/dashboard/application_controller.rb
module Dashboard
class ApplicationController < ::ApplicationController
before_filter :authenticate_user!
end
end
# app/controllers/dashboard/dashboard_controller.rb
module Dashboard
class DashboardController < ApplicationController
def index
end
end
end
# app/controllers/member/application_controller.rb
module Member
class ApplicationController < ::ApplicationController
before_filter :authenticate_user!
end
end
# app/controllers/member/member_controller.rb
module Member
class MemberController < ApplicationController
def index
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment