diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/agents_controller.rb | 2 | ||||
| -rw-r--r-- | app/views/agents/index.html.erb | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/agents_controller.rb b/app/controllers/agents_controller.rb index 4acef9d..dc2717a 100644 --- a/app/controllers/agents_controller.rb +++ b/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 diff --git a/app/views/agents/index.html.erb b/app/views/agents/index.html.erb index 3a6b738..75adfdb 100644 --- a/app/views/agents/index.html.erb +++ b/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> |
