Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
post '/checkout' do
n = rand(3)
flash[:error] = "There was an error processing your payment" if n == 0
flash[:success] = "Your payment was successful" if n > 0
redirect to('/discount') if n == 2
redirect to('/finish')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment