public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7
post '/buy/:animal' do
animal = params[:animal]
#code that adds an animal to the shopping basket goes here
flash[:success] = "A #{animal} was successfully added to your basket"
flash[:warning] = "Warning! Buying too many ducks can drive you quackers" if animal == 'duck'
redirect '/'
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.