Adjusted donation state

This commit is contained in:
2017-12-15 23:12:43 +01:00
parent 44bc6e1118
commit f6558753f3
2 changed files with 27 additions and 23 deletions
+3 -3
View File
@@ -7,15 +7,15 @@ class ChargesController < ApplicationController
begin
@amount = Float(@amount).round(2)
rescue
flash[:error] = 'Bitte geben sie einen Betrag in CHF ein.'
flash[:danger] = 'Bitte geben sie einen Betrag in CHF ein.'
redirect_to donation_path
return
end
@amount = (@amount * 100).to_i # Must be an integer!
if @amount < 500
flash[:error] = 'Ihre Spende muss mindestens 5.- CHF betragen.'
if @amount < 1000
flash[:danger] = 'Ihre Spende muss mindestens 10.- CHF betragen.'
redirect_to donation_path
return
end