Created
March 2, 2014 15:05
-
-
Save kevinrobayna/9307847 to your computer and use it in GitHub Desktop.
This file contains 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 Web App Example | |
%link{:rel => "stylesheet", :type => "text/css", :href => "/stylesheet.css"} | |
%script{:type => "text/javascript", :src => "/application.js"} | |
%body | |
#Header | |
!= haml :"header" | |
#contents | |
= yield | |
#footer | |
!= haml :"footer" |
This file contains 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/base' | |
require 'haml' | |
require 'coffee-script' | |
require 'sass' | |
class WebAppExample < Sinatra::Base | |
set :root, File.dirname(__FILE__) | |
#Needed for CoffeeScript and SCSS | |
get '/application.js' do | |
coffee :application | |
end | |
get '/stylesheet.css' do | |
scss :stylesheet | |
end | |
#Starting actual application | |
get '/' do | |
haml :index | |
end | |
end |
Files into repository
../WebAppExample
|-- Gemfile
|-- Gemfile.lock
|-- README.md
|-- Rakefile
|-- WebAppExample.rb
|-- config.ru
|-- public
`-- views
|-- about.haml
|-- coffee
| `-- application.coffee
|-- footer.haml
|-- header.haml
|-- index.haml
|-- layout.haml
`-- scss
`-- stylesheet.scss
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why it dont work?
Thanks for help