Created
February 28, 2011 15:01
-
-
Save tbuehlmann/847427 to your computer and use it in GitHub Desktop.
application.rb
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
| HELLO <%= bar %> |
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 'haml' | |
| require 'sinatra/base' | |
| class Application < Sinatra::Base | |
| configure do | |
| enable :static | |
| set :views, File.join(File.dirname(__FILE__), 'views') | |
| set :public, File.join(File.dirname(__FILE__), 'public') | |
| end | |
| get '/' do | |
| haml :index | |
| end | |
| 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
| $LOAD_PATH.unshift(File.dirname(__FILE__)) | |
| require 'application' | |
| run Application |
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 World! | |
| - bar = "baz" | |
| = erb :_foo, :locals => {:bar => bar} |
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{:xmlns => 'http://www.w3.org/1999/xhtml'} | |
| %head | |
| %title Application | |
| %link{:rel => 'stylesheet', :type => 'text/css', :href => 'css/style.css'} | |
| %meta{:content => 'text/html; charset=utf-8', :'http-equiv' => 'Content-Type'} | |
| %body | |
| = yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment