Skip to content
Browse files

Adding 'your share will be' estimation

  • Loading branch information...
1 parent fc82e7f commit f5a4867b8f439f7f2a93e86859485a719d37d663 @joshe committed Sep 2, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 Gemfile.lock
  2. +1 −0 app/controllers/events_controller.rb
  3. +1 −0 app/views/events/show.html.haml
View
2 Gemfile.lock
@@ -48,7 +48,7 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
- mysql2 (0.2.7)
+ mysql2 (0.2.11)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
View
1 app/controllers/events_controller.rb
@@ -27,6 +27,7 @@ def show
@event = Event.find(params[:id])
@event_user_count = @event.users.size
@event_cpp = @event.event_cost / @event_user_count
+ @your_share_will_be = @event.event_cost / (@event_user_count + 1)
@event_users = @event.users
@user = User.find(session[:user_id])
@user_is_in = @event_users.include?(@user)
View
1 app/views/events/show.html.haml
@@ -23,6 +23,7 @@
- unless @user_is_in
= button_to "I am in", :action => "join", :id => @event.id
+ = "If you join, each person will pay a max of $#{@your_share_will_be}"
.spread
.twshare.left

0 comments on commit f5a4867

Please sign in to comment.
Something went wrong with that request. Please try again.