fix user count, change headline a bit

This commit is contained in:
jomo
2014-09-22 05:23:24 +02:00
parent 9cf5c6262c
commit beecf7a939
2 changed files with 12 additions and 8 deletions

View File

@@ -21,7 +21,9 @@ class UsersController < ApplicationController
else else
@users = User.where.not(id: User.first.id) #Remove first user @users = User.where.not(id: User.first.id) #Remove first user
end end
@users = @users.order("role_id desc", "confirmed desc", :name).page(params[:page]) @users = @users.order("role_id desc", "confirmed desc", :name)
@count = @users.length
@users = @users.page(params[:page])
end end
def show def show

View File

@@ -1,10 +1,12 @@
<% if params[:role] %> <h1>
<h1><%= title "All '#{params[:role]}' role users" %></h1> <% if params[:role] %>
<%= link_to "show all", users_path %> <%= title "All #{params[:role]}-role users" %>
<% else %> <% else %>
<h1><%= title "All Users" %></h1> <%= title "All Users" %>
<% end %> <% end %>
<p>User count: <%= User.count - 1 %></p> (<%= @count %>)
</h1>
<%= link_to "show all", users_path if params[:role] %>
<div id="userlist"> <div id="userlist">
<% @users.each do |u| %> <% @users.each do |u| %>