Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

split tables out by gender and age

  • Loading branch information...
commit 708f3c558fffd306f9107f11c5f0ece7e0835907 1 parent be5d0fd
@mikepmunroe authored
View
6 app/controllers/southie_controller.rb
@@ -1,6 +1,12 @@
class SouthieController < ApplicationController
def index
@athletes = Athlete.where(:affiliate => 'southie').order("total asc")
+ @individual_men = Athlete.where(:affiliate => 'southie').where('age < 40').where('gender == "Male"').order('total asc')
+ @masters_40_44_men = Athlete.where(:affiliate => 'southie').where('age > 39 and age < 45').where('gender == "Male"').order('total asc')
+ @masters_50_54_men = Athlete.where(:affiliate => 'southie').where('age > 49 and age < 55').where('gender == "Male"').order('total asc')
+ @masters_55_59_men = Athlete.where(:affiliate => 'southie').where('age > 54 and age < 60').where('gender == "Male"').order('total asc')
+ @masters_60_men = Athlete.where(:affiliate => 'southie').where('age > 60').where('gender == "Male"').order('total asc')
+ @individual_women = Athlete.where(:affiliate => 'southie').where('age < 40').where('gender == "Female"').order('total asc')
end
end
View
8 app/controllers/wicked_controller.rb
@@ -1,6 +1,14 @@
class WickedController < ApplicationController
def index
@athletes = Athlete.where(:affiliate => 'wicked').order("total asc")
+ @individual_men = Athlete.where(:affiliate => 'wicked').where('age < 40').where('gender == "Male"').order('total asc')
+ @masters_40_44_men = Athlete.where(:affiliate => 'wicked').where('age > 39 and age < 45').where('gender == "Male"').order('total asc')
+ @masters_45_49_men = Athlete.where(:affiliate => 'wicked').where('age > 44 and age < 50').where('gender == "Male"').order('total asc')
+ @masters_50_54_men = Athlete.where(:affiliate => 'wicked').where('age > 49 and age < 55').where('gender == "Male"').order('total asc')
+ @individual_women = Athlete.where(:affiliate => 'wicked').where('age < 40').where('gender == "Female"').order('total asc')
+ @masters_40_44_women = Athlete.where(:affiliate => 'wicked').where('age > 39 and age < 45').where('gender == "Female"').order('total asc')
+ @masters_45_49_women = Athlete.where(:affiliate => 'wicked').where('age > 44 and age < 50').where('gender == "Female"').order('total asc')
+ @masters_55_59_women = Athlete.where(:affiliate => 'wicked').where('age > 54 and age < 60').where('gender == "Female"').order('total asc')
end
end
View
1  app/views/shared/_athletes.html.erb
@@ -1,4 +1,3 @@
-<h1>Athletes</h1>
<table class="table table-striped">
<thead>
<tr>
View
11 app/views/southie/index.html.erb
@@ -1,2 +1,11 @@
-<%= render :partial => 'shared/athletes', :object => @athletes %>
+<h3>Individual Men</h3>
+<%= render :partial => 'shared/athletes', :object => @individual_men %>
+<h3>Individual Women</h3>
+<%= render :partial => 'shared/athletes', :object => @individual_women %>
+
+<h3>Masters Men 40-44</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_40_44_men %>
+
+<h3>Masters Men 50-54</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_50_54_men %>
View
20 app/views/wicked/index.html.erb
@@ -1,2 +1,20 @@
-<%= render :partial => 'shared/athletes', :object => @athletes %>
+<h3>Individual Men</h3>
+<%= render :partial => 'shared/athletes', :object => @individual_men %>
+<h3>Individual Women</h3>
+<%= render :partial => 'shared/athletes', :object => @individual_women %>
+<h3>Masters Men 40-44</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_40_44_men %>
+<h3>Masters Women 40-44</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_40_44_women %>
+
+<h3>Masters Men 45-49</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_45_49_men %>
+<h3>Masters Women 45-49</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_45_49_women %>
+
+<h3>Masters Men 50-54</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_50_54_men %>
+
+<h3>Masters Women 55-59</h3>
+<%= render :partial => 'shared/athletes', :object => @masters_55_59_women %>
Please sign in to comment.
Something went wrong with that request. Please try again.