Skip to content

Instantly share code, notes, and snippets.

@etozzato
Created November 11, 2009 03:38
Show Gist options
  • Save etozzato/231537 to your computer and use it in GitHub Desktop.
Save etozzato/231537 to your computer and use it in GitHub Desktop.
# app.rb
get '/number.js' do
@n = rand(100)
erb :number
end
<!-- number.erb -->
document.write('<div style="color:#eee; padding:15px; width:200px; border:1px solid #ffcf0e; background-color:#fff; margin:5px;"><a href="#" onclick="alert(\'The Number is <%= @n %>\')">Click to Know the Number</a></div>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment