Cleaned up User admin index

This commit is contained in:
2013-01-24 02:35:14 -05:00
parent 75f594f9ea
commit 0fe499b701
3 changed files with 13 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ class UsersController < ApplicationController
# GET /users
# GET /users.json
def index
@users = User.all
@users = Kaminari.paginate_array(User.all).page(params[:page]).per(10)
respond_to do |format|
format.html # index.html.erb

View File

@@ -10,7 +10,7 @@ class User < ActiveRecord::Base
validates :username, :presence => true, :uniqueness => true
# Setup accessible (or protected) attributes for your model
attr_accessible :username, :email, :password, :password_confirmation, :remember_me
attr_accessible :username, :email, :password, :password_confirmation, :remember_me, :is_admin
has_many :topics, :dependent => :destroy
has_many :posts, :dependent => :destroy

View File

@@ -1,8 +1,11 @@
<h1>All Users</h1>
<div class="module" style="padding:15px 25px 0px 25px;">
<div class='module_header'>
<h1>All Users</h1>
</div>
<table id="users">
<thead>
<tr>
<table id="users">
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Login Count</th>
@@ -28,9 +31,10 @@
<th><%= link_to "Delete", user, :method => :delete, :confirm => "Are you sure?" %></th>
</tr>
<% end %>
</tbody>
</table>
<div align="center"> <%= paginate(@users)%> </div>
<p><%= link_to "New User", new_user_path %></p>
<div class="clear"></div>
</div>