Created
          July 5, 2012 14:58 
        
      - 
      
 - 
        
Save lucassmagal/3054184 to your computer and use it in GitHub Desktop.  
    Sinatra app example
  
        
  
    
      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
    
  
  
    
  | require 'sinatra' | |
| require 'haml' | |
| get '/' do | |
| haml :index | |
| end | |
| get '/:name' do |n| | |
| @name = n | |
| haml :index | |
| 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
    
  
  
    
  | source :rubygems | |
| gem 'sinatra' | |
| gem 'haml' | 
  
    
      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
    
  
  
    
  | %h1= "Hello #{@name}!" | 
  
    
      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
    
  
  
    
  | !!! | |
| %html | |
| %head | |
| %title Hello World | |
| %body | |
| = yield | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
O código abaixo funciona para mim.