Permalink
Browse files

Added % goal to the home page

  • Loading branch information...
1 parent 1e320d7 commit fe305abd53a7c2644dbc05d80e67ab8367e13c6f @jaderobbins jaderobbins committed Nov 11, 2011
Showing with 8 additions and 0 deletions.
  1. +7 −0 app/controllers/home_controller.rb
  2. +1 −0 app/views/home/index.html.erb
@@ -1,7 +1,9 @@
class HomeController < ApplicationController
def index
+
@volunteer = Volunteer.new
+
#look for the neighborhood url param and then preset the neighborhood
if !params[:neighborhood].nil?
begin
@@ -15,6 +17,11 @@ def index
@volunteer.neighborhood_id = params[:neighborhood]
end
end
+
+ # 26/130 volunteers = 20% to our goal.
+ @volCount = Volunteer.all.count
+ @volPercent = @volCount/130
+
end
end
@@ -42,6 +42,7 @@
<div class="span-24 last">
<h2>Volunteer</h2>
<div class="prepend-2 span-20 append-2 last">
+ <h3><%=@volCount%>/130 volunteers = <%=@volPercent%>% of our goal</h3>
<p>We need your help raising 45,000 pounds of food, one bag at a time! Please fill out the volunteer form below and select a neighborhood close to where you live. Volunteers will be expected to pull together a small group of friends and family to join them in making this event a huge success.</p>
<p>Here is a summary of what we are asking you to do:</p>

0 comments on commit fe305ab

Please sign in to comment.