Cleaned up User admin index
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user