Skip to content

Commit 17a416e

Browse files
author
Simon Funke
committed
improved api
1 parent fa6c354 commit 17a416e

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

app/controllers/country_maps_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class CountryMapsController < ApplicationController
22
# GET /country_maps
33
# GET /country_maps.json
44
def index
5-
@country_maps = CountryMap.select([:name]).all
5+
@country_maps = CountryMap.select([:name, :longitude, :latitude]).all
66

77
respond_to do |format|
88
format.html # index.html.erb

app/models/country_measurement.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
class CountryMeasurement < ActiveRecord::Base
22
belongs_to :country_map, :foreign_key => :country
3+
4+
default_scope :order => 'month DESC'
35
end

app/views/country_measurements/index.html.erb

-16
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
<table>
44
<tr>
55
<th>Month</th>
6-
<th>Downloadthroughputsplitbyclientandbyserver</th>
7-
<th>Uploadthroughputsplitbyclientandbyserver</th>
8-
<th>Rttsplitbyclientandbyserver</th>
9-
<th>Netlimitedsplitbyclientandbyserver</th>
10-
<th>Clientlimitedsplitbyclientandbyserver</th>
11-
<th>Winscalercvdsplitbyclientandbyserver</th>
126
<th>Numberofclientssplitbyclientandbyserver</th>
137
<th></th>
148
<th></th>
@@ -18,20 +12,10 @@
1812
<% @country_measurements.each do |country_measurement| %>
1913
<tr>
2014
<td><%= country_measurement.month %></td>
21-
<td><%= country_measurement.DownloadThroughputSplitByClientAndByServer %></td>
22-
<td><%= country_measurement.UploadThroughputSplitByClientAndByServer %></td>
23-
<td><%= country_measurement.RTTSplitByClientAndByServer %></td>
24-
<td><%= country_measurement.NetLimitedSplitByClientAndByServer %></td>
25-
<td><%= country_measurement.ClientLimitedSplitByClientAndByServer %></td>
26-
<td><%= country_measurement.WinScaleRcvdSplitByClientAndByServer %></td>
2715
<td><%= country_measurement.NumberOfClientsSplitByClientAndByServer %></td>
28-
<td><%= link_to 'Show', country_measurement %></td>
29-
<td><%= link_to 'Edit', edit_country_measurement_path(country_measurement) %></td>
30-
<td><%= link_to 'Destroy', country_measurement, confirm: 'Are you sure?', method: :delete %></td>
3116
</tr>
3217
<% end %>
3318
</table>
3419

3520
<br />
3621

37-
<%= link_to 'New Country measurement', new_country_measurement_path %>

0 commit comments

Comments
 (0)