Commit 6469e16e

mo khan <mo@mokhan.ca>
2013-12-30 04:40:26
display all users in users admin page.
1 parent e6f1118
Changed files (2)
app
controllers
views
admin
app/controllers/admin/users_controller.rb
@@ -1,6 +1,7 @@
 module Admin
   class UsersController < AdminController
     def index
+      @users = User.all
     end
   end
 end
app/views/admin/users/index.html.erb
@@ -0,0 +1,46 @@
+<div class="row">
+  <div class="span12">
+    <table class="table table-striped">
+      <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>
+        </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>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
+  </div>
+</div>