Skip to content

Instantly share code, notes, and snippets.

@igorgue
Created July 2, 2011 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorgue/1061639 to your computer and use it in GitHub Desktop.
Save igorgue/1061639 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
get '/' do
<<-end_page
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed">
<h1>JQuery Error</h1>
<a href="/" data-icon="home">Home</a>
<a href="/" data-icon="delete">Logout</a>
</div><!-- /header -->
<div data-role="content">
<h1>Go to /redirect_to <a href="/redirect_to">here</a>.
</div><!-- /content -->
<div data-role="footer" data-position="fixed">
<h1>Footer</h1>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
end_page
end
get '/redirect_to' do
<<-end_page
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed">
<h1>JQuery Error</h1>
<a href="/" data-icon="home">Home</a>
<a href="/" data-icon="delete">Logout</a>
</div><!-- /header -->
<div data-role="content">
<form action="/redirect_to" method="post" accept-charset="utf-8">
<p><input type="submit" value="Redirec to /thank_you &rarr;"></p>
</form>
</div><!-- /content -->
<div data-role="footer" data-position="fixed">
<h1>Footer</h1>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
end_page
end
post '/redirect_to' do
redirect '/thank_you'
end
get '/thank_you' do
<<-end_page
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed">
<h1>JQuery Error</h1>
<a href="/" data-icon="home">Home</a>
<a href="/" data-icon="delete">Logout</a>
</div><!-- /header -->
<div data-role="content">
<h1>Thanks!</h1>
</div><!-- /content -->
<div data-role="footer" data-position="fixed">
<h1>Footer</h1>
</div><!-- /footer -->
</div><!-- /page -->
</body>
</html>
end_page
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment