What is the typical format/structure for creating an administrative area in a Rails application?
Specifically I am stumped in the vicinity of these topics:
Thank you!
You can have 2 controllers, one for the public part and other for the admin and use admin namespacing:
map.namespace(:admin, :path_prefix => 'settings', :name_prefix => 'admin_') do |admin|
admin.resources :users
end
It would map to /settings/users and the controller would have to be prefixed by Admin::
like Admin::UsersController
, also the controller file has to be put in an admin folder under the app/controllers dir.
There's a series of Railscasts that shows an approach which avoids having a separate admin area by using conditionals in the views and controllers: Where Administration Goes.
This might not be suitable for your use case, but it's worth a look.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With