Created
November 11, 2009 03:38
-
-
Save etozzato/231537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app.rb | |
get '/number.js' do | |
@n = rand(100) | |
erb :number | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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