Created
January 30, 2010 13:03
-
-
Save robotmay/290543 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In config/routes.rb: | |
map.namespace :admin do |admin| | |
admin.root :controller => :photographs | |
admin.resources :albums | |
admin.resources :categories | |
admin.resources :photographs | |
admin.resources :posts | |
end | |
# Inside /app/controllers I have a folder called admin, and inside that a controller called admin_controller.rb (/app/controllers/admin/admin_controller.rb): | |
class Admin::AdminController < ApplicationController | |
# You can put things like :require_user in here, as it will affect the whole admin panel | |
end | |
# Then all my admin controllers extend the admin_controller, here's an example: | |
class Admin::AlbumsController < Admin::AdminController | |
# Do stuff here! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment