Created
April 5, 2016 16:16
-
-
Save adamluzsi/c6871406bf4c45a04f39fa8e8637a70b to your computer and use it in GitHub Desktop.
simple_website
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 'rack/app' | |
require 'rack/app/front_end' | |
class App < Rack::App | |
apply_extensions :front_end | |
helpers do | |
def method_that_can_be_used_in_template | |
'hello world!' | |
end | |
end | |
# use ./app/layout.html.erb as layout, this is optionable | |
layout 'layout.html.erb' | |
# at '/' the endpoint will serve (render) | |
# the ./app/index.html content as response body and wrap around with layout if layout is given | |
get '/' do | |
render 'index.html' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment