Commit 64dd29d
Changed files (2)
app
controllers
views
agents
app/controllers/agents_controller.rb
@@ -1,6 +1,6 @@
class AgentsController < ApplicationController
def index
- @agents = Agent.all
+ @agents = Agent.all.order(created_at: :desc)
end
def show
app/views/agents/index.html.erb
@@ -9,15 +9,16 @@
<thead>
<tr>
<th>Hostname</th>
- <th colspan="4"></th>
+ <th>Created At</th>
+ <th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @agents.each do |agent| %>
<tr>
- <td><%= agent.hostname %></td>
+ <td><%= link_to agent.hostname, agent_path(agent) %></td>
+ <td><%= agent.created_at %></td>
<td><%= link_to 'Events', agent_events_path(agent) %></td>
- <td><%= link_to 'Show', agent %></td>
<td><%= link_to 'Edit', edit_agent_path(agent) %></td>
<td><%= link_to 'Destroy', agent, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>