<% require 'cgi' cgi = CGI.new if cgi.has_key?('bottles') num = cgi['bottles'].to_i else num = 99 end while num > 0 %>

<%= num %> bottles of beer on the wall,
<%= num %> bottles of beer.
Take one down, pass it around,
<%= num - 1 %> bottles of beer on the wall.

<% num = num - 1 end %>