osem-fcy/app/controllers/admin/users_controller.rb
Henne Vogelsang 252e1fe544 Completely rework the navigation
Get rid of the admin layout
Get rid of the navbar custom style, use bootstrap-sass variables instead
Get rid of all the scaffold files
2013-06-27 16:58:20 +02:00

19 lines
671 B
Ruby

class Admin::UsersController < ApplicationController
before_filter :verify_admin
def index
@users = User.all(:joins => :person,
:order => "people.last_name ASC",
:select => "users.*,
people.last_name AS last_name,
people.first_name AS first_name,
people.public_name AS public_name,
people.email AS email")
end
def update
user = User.find(params[:id])
user.update_attributes!(params[:user])
redirect_to admin_users_path, :notice => "Updated #{user.email}"
end
end