In Rails, how to have an /admin section, and then controllers within the admin section? -


i want have /admin section in application, , have routes within /admin section like:

www.example.com/admin/ (only users have acess section)

then have controllers in section like:

/admin/users/{add, new, etc} 

what options this? (using rails 3)

do in routes.rb:

  namespace :admin     resources :users   end 

see http://guides.rubyonrails.org/routing.html more detail.

then in each admin controller you'll need before_filter:

before_filter :authorized? def authorized?     #check if authorized here. end 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -