Cleaned up User admin index
This commit is contained in:
@@ -7,7 +7,7 @@ class UsersController < ApplicationController
|
|||||||
# GET /users
|
# GET /users
|
||||||
# GET /users.json
|
# GET /users.json
|
||||||
def index
|
def index
|
||||||
@users = User.all
|
@users = Kaminari.paginate_array(User.all).page(params[:page]).per(10)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class User < ActiveRecord::Base
|
|||||||
validates :username, :presence => true, :uniqueness => true
|
validates :username, :presence => true, :uniqueness => true
|
||||||
|
|
||||||
# Setup accessible (or protected) attributes for your model
|
# 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 :topics, :dependent => :destroy
|
||||||
has_many :posts, :dependent => :destroy
|
has_many :posts, :dependent => :destroy
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
<div class="module" style="padding:15px 25px 0px 25px;">
|
||||||
|
<div class='module_header'>
|
||||||
<h1>All Users</h1>
|
<h1>All Users</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table id="users">
|
<table id="users">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -28,9 +31,10 @@
|
|||||||
<th><%= link_to "Delete", user, :method => :delete, :confirm => "Are you sure?" %></th>
|
<th><%= link_to "Delete", user, :method => :delete, :confirm => "Are you sure?" %></th>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
<div align="center"> <%= paginate(@users)%> </div>
|
||||||
<p><%= link_to "New User", new_user_path %></p>
|
<p><%= link_to "New User", new_user_path %></p>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user