Add necessary user foreign keys in appropriate tables (ie customer in xxx_create_users.rb), plus other fields you may want to use in your user table (ie role):
Comment out the default redirection after login and put your own (ie customers): in the account_controller.rb, just before
the flash[:notice] = “Logged in successfully”.
Also add the else for the the invalid login:
Change the action in the signup and logout functions in the account_controller.rb file from index to login
Add (optionally) more fields (role) in the signup page (app/views/account/signup.rhtml):
<%= f.select :role, ['A','R','C'] %>
Add restrictions for displaying records depending on user logged in, by using the conditions_for_collection of the activescaffold plugin in app/controllers/customers_controller.rb:
def conditions_for_collection
['customers.user_id = (?)', current_user.id]
end
Add a menu page layout in app/views/layouts/_menu.rhtml: