more return paths

This commit is contained in:
Andrew Cantino 2015-09-03 07:53:42 -07:00
parent 41f4d6e339
commit 4f329a86ed
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ class ApplicationController < ActionController::Base
else
agents_path
end
when /\A#{Regexp::escape scenarios_path}\/\d+\z/, agents_path
when /\A#{(Regexp::escape scenarios_path)}/, /\A#{(Regexp::escape agents_path)}/, /\A#{(Regexp::escape events_path)}/
ret
end
end

View file

@ -19,7 +19,7 @@
<% @events.each do |event| %>
<% next unless event.agent %>
<%= content_tag :tr, class: (highlighted?(event.id) ? 'hl' : nil) do %>
<td><%= link_to event.agent.name, agent_path(event.agent) %></td>
<td><%= link_to event.agent.name, agent_path(event.agent, return: request.fullpath) %></td>
<td title='<%= event.created_at %>'><%= time_ago_in_words event.created_at %> ago</td>
<td class='payload'><%= truncate event.payload.to_json, :length => 90, :omission => "" %></td>
<td>
@ -40,7 +40,7 @@
<% if @agent %>
<div class="btn-group">
<%= link_to icon_tag('glyphicon-chevron-left') + ' Back'.html_safe, agents_path, class: "btn btn-default" %>
<%= link_to icon_tag('glyphicon-eye-open') + ' View Agent'.html_safe, agent_path(@agent, return: request.fullpath), class: "btn btn-default" %>
<%= link_to icon_tag('glyphicon-random') + ' See all events'.html_safe, events_path, class: "btn btn-default" %>
</div>
<% end %>