Topic: How to make the users administration

Hello, I am quite new to Rails and I want have an application, which I need to create some simple administration.

The application has models for customers and users. User is connected to customer and a customer may have more users. But think is not important, I think.

I need to make some administration page to add, edit and delete customers and users. I created a new model "admins" which has own controller, view and model. I would like to authenticate as someone from admin table. So this is what I have done:

I created a namespace in routes.rb that contains this:

namespace :admin do
    #root :to => "users#index"
    root :to => "Admin::Users#index"
    resources :users
    resources :customers
    resources :admins
  end

I copied admins, applications, customers and users controllers to controllers/admin and changed the method definitions like this:

class Admin::AdminsController < Admin::ApplicationController

I modified also the method to login, but I am not able to login as admin. I know that I am missing some important steps, but I dont't know which ones.

Could somebody help, how to customize the routes and how to create login method for this?

Thank you very much.

Last edited by Wizzard (2012-10-26 07:56:44)