Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think namespaces is the solution to the problem you have here:</p> <pre><code>map.namespace :admin do |admin| admin.resources :customers end </code></pre> <p>Which will create routes <code>admin_customers</code>, <code>new_admin_customers</code>, etc.</p> <p>Then inside the <code>app/controller</code> directory you can have an <code>admin</code> directory. Inside your admin directory, create an admin controller:</p> <pre><code>./script/generate rspec_controller admin/admin class Admin::AdminController &lt; ApplicationController layout "admin" before_filter :login_required end </code></pre> <p>Then create an admin customers controller:</p> <pre><code>./script/generate rspec_controller admin/customers </code></pre> <p>And make this inhert from your ApplicationController:</p> <pre><code>class Admin::CustomersController &lt; Admin::AdminController </code></pre> <p>This will look for views in <code>app/views/admin/customers</code> and will expect a layout in <code>app/views/layouts/admin.html.erb</code>.</p> <p>You can then use whichever plugin or code you like to actually do your administration, streamline, ActiveScaffold, whatever personally I like to use <code>resourcecs_controller</code>, as it saves you a lot of time if you use a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" rel="nofollow noreferrer">REST</a> 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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload