Permalink
Browse files

Fixed some redundant array sorting in the views, use name.to_str in t…

…he views. Added new notattending view for those marked as not attending ceremony or not attending reception, excluding guests.
  • Loading branch information...
1 parent ab9a173 commit e930a6179cc32d13f1908eac1480450c02216c6f @anthonyrhook committed Jul 13, 2011
@@ -16,4 +16,8 @@ def meals
@people = Person.where(:is_attending_reception => true)
@meals = Meal.all
end
+
+ def notattending
+ @people = Person.order('last_name').where(:is_attending_reception => false, :is_attending_ceremony => false, :is_guest => false)
+ end
end
@@ -1,10 +1,10 @@
<h1>Attendees</h1>
<h2>Ceremony</h2>
-<h2>Confirmed Attending Ceremony: <%= Person.where(:is_attending_ceremony => true).count %></h2>
+<h2>Confirmed Attending Ceremony: <%= @people.count %></h2>
<ul>
<% @people.each do |person| %>
- <li><%= person.first_name + ' ' + person.last_name %></li>
+ <li><%= person.name.to_str %></li>
<% end %>
</ul>
@@ -1,5 +1,5 @@
<h1>Check Attendees</h1>
<%= link_to 'Ceremony Attenance', admin_attendees_ceremony_path %><br />
<%= link_to 'Reception Attendance', admin_attendees_reception_path %><br />
-<%= link_to 'Meal Totals', admin_attendees_meals_path %>
-
+<%= link_to 'Meal Totals', admin_attendees_meals_path %><br />
+<%= link_to 'Not Attending', admin_attendees_notattending_path %>
@@ -0,0 +1,10 @@
+<h1>Attendees</h1>
+
+<h2>Not Attending</h2>
+<h2>Not attending ceremony or reception: <%= @people.count %></h2>
+<ul>
+<% @people.each do |person| %>
+ <li><%= person.name.to_str %></li>
+<% end %>
+</ul>
+
@@ -1,10 +1,10 @@
<h1>Attendees</h1>
<h2>Reception</h2>
-<h2>Confirmed Attending Reception: <%= Person.where(:is_attending_reception => true).count %></h2>
+<h2>Confirmed Attending Reception: <%= @people.count %></h2>
<ul>
<% @people.each do |person| %>
- <li><%= person.name %></li>
+ <li><%= person.name.to_str %></li>
<% end %>
</ul>
View
@@ -13,7 +13,8 @@
get 'attendees/ceremony' => 'attendees#ceremony'
get 'attendees/reception' => 'attendees#reception'
get 'attendees/meals' => 'attendees#meals'
- end
+ get 'attendees/notattending' => 'attendees#notattending'
+end
root :to => "rsvp#index"
match 'disclaimer' => 'rsvp#disclaimer'

0 comments on commit e930a61

Please sign in to comment.