Commit 7a0bd9ae
Changed files (2)
app
controllers
admin
views
admin
users
app/controllers/admin/users_controller.rb
@@ -1,7 +1,7 @@
module Admin
class UsersController < AdminController
def index
- @users = User.all
+ @users = User.includes(:avatar)
end
end
end
app/views/admin/users/index.html.erb
@@ -1,43 +1,38 @@
<div class="row-fluid">
<div class="span12">
- <table class="table table-striped">
+ <table class="table table-striped table-condensed">
<thead>
<tr>
- <th>name</th>
- <th>email</th>
- <th>sign in count</th>
- <th>current sign in</th>
- <th>last_sign_in_at</th>
- <th>created_at</th>
- <th>website</th>
- <th>twitter</th>
- <th>facebook</th>
- <th>city</th>
- <th>latitude</th>
- <th>longitude</th>
- <th>authentication_token</th>
- <th>full_address</th>
- <th>creations_count</th>
+ <td></td>
+ <td>name</td>
+ <td>location</td>
+ <td>created_at</td>
</tr>
</thead>
<tbody>
<%- @users.each do |user| %>
<tr>
- <td><%= user.name %></td>
- <td><%= user.email %></td>
- <td><%= user.sign_in_count %></td>
- <td><%= user.current_sign_in_at %></td>
- <td><%= user.last_sign_in_at %></td>
- <td><%= user.created_at %></td>
- <td><%= user.website %></td>
- <td><%= user.twitter %></td>
- <td><%= user.facebook %></td>
- <td><%= user.city %></td>
- <td><%= user.latitude %></td>
- <td><%= user.longitude %></td>
- <td><%= user.authentication_token %></td>
- <td><%= user.full_address %></td>
- <td><%= user.creations_count %></td>
+ <td><%= avatar_for(user) %></td>
+ <td>
+ <p>(<%= user.creations_count %>) <%= user.name %></p>
+ <p><%= user.email %></p>
+ <p><%= user.full_address %></p>
+ <p><%= user.city %></p>
+ <p>website: <%= user.website %></p>
+ <p>twitter: <%= user.twitter %></p>
+ <p>facebook: <%= user.facebook %></p>
+ </td>
+ <td>
+ <p>latitude: <%= user.latitude %></p>
+ <p>longitude: <%= user.longitude %></p>
+ </td>
+ <td>
+ <p>created at: <%= user.created_at %></p>
+ <p>auth token: <%= user.authentication_token %></p>
+ <p>sign in count: <%= user.sign_in_count %></p>
+ <p>current sign in: <%= user.current_sign_in_at %></p>
+ <p>last sign in: <%= user.last_sign_in_at %></p>
+ </td>
</tr>
<% end %>
</tbody>