Permalink
Browse files

Merge pull request #62 from lgierth/fix-trace-uri

Use absolute URIs for traces
  • Loading branch information...
2 parents 16ef119 + c6c654d commit c89fe90d36c71ca1e054f695fc5bd3c8f82ffd51 @seancribbs seancribbs committed Jul 25, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −2 lib/webmachine/trace/static/tracelist.erb
  2. +2 −1 lib/webmachine/trace/trace_resource.rb
View
4 lib/webmachine/trace/static/tracelist.erb
@@ -6,8 +6,8 @@
<body>
<h1>Traces</h1>
<ul>
- <% traces.each do |trace| %>
- <li><a href="<%= trace %>"><%= trace %></a></li>
+ <% traces.each do |(trace, uri)| %>
+ <li><a href="<%= uri %>"><%= trace %></a></li>
<% end %>
</ul>
</body>
View
3 lib/webmachine/trace/trace_resource.rb
@@ -77,7 +77,8 @@ def produce_file
end
def produce_list
- traces = Trace.traces
+ base = request.uri.path.chomp("/")
+ traces = Trace.traces.map {|t| [ t, "#{base}/#{t}" ] }
self.class.tracelist.result(binding)
end

0 comments on commit c89fe90

Please sign in to comment.