mirror of
				https://github.com/sinatra/sinatra
				synced 2023-03-27 23:18:01 -04:00 
			
		
		
		
	this is it
This commit is contained in:
		
						commit
						72be291da2
					
				
					 17 changed files with 477 additions and 0 deletions
				
			
		
							
								
								
									
										20
									
								
								examples/hello/test.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								examples/hello/test.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
$LOAD_PATH.unshift '../../lib/'
 | 
			
		||||
require 'sinatra'
 | 
			
		||||
 | 
			
		||||
get '/' do
 | 
			
		||||
  body <<-HTML
 | 
			
		||||
  <form method="POST"><input type="text" name="name"/><input type="submit"></form>
 | 
			
		||||
  HTML
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
post '/' do
 | 
			
		||||
  body "You entered #{params[:name]}"
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
get '/erb' do
 | 
			
		||||
  erb :index
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
get '/test' do
 | 
			
		||||
  erb "Hello <%= params[:name] %>"
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										1
									
								
								examples/hello/views/index.erb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								examples/hello/views/index.erb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
<%= 1 + 3 %>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue