I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get running, but I don't quite understand how to set up either one as a backend administration page. They seem designed to work like standard Ruby on Rails generators/scaffolds for creating visible front ends with model-view-controller-table name correspondence.
How do you create a admin_players interface when players is already in use and you want to avoid, as much as possible, affecting any of its related files?
The show, edit and index of the original resource are not usuable for the administrator.
Do check out active_admin at https://github.com/gregbell/active_admin.
Use https://github.com/sferik/rails_admin.
I think namespaces is the solution to the problem you have here:
Which will create routes
admin_customers
,new_admin_customers
, etc.Then inside the
app/controller
directory you can have anadmin
directory. Inside your admin directory, create an admin controller:Then create an admin customers controller:
And make this inhert from your ApplicationController:
This will look for views in
app/views/admin/customers
and will expect a layout inapp/views/layouts/admin.html.erb
.You can then use whichever plugin or code you like to actually do your administration, streamline, ActiveScaffold, whatever personally I like to use
resourcecs_controller
, as it saves you a lot of time if you use a REST style architecture, and forcing yourself down that route can save a lot of time elsewhere. Though if you inherited the application that's a moot point by now.I have used Streamlined pretty extensively.
To get Streamline working you create your own controllers - so you can actually run it completely apart from the rest of your application, and you can even run it in a separate 'admin' folder and namespace that can be secured with .
Here is the Customers controller from a recent app: