Created
July 6, 2019 22:09
-
-
Save mattsan/4210646da7e7c9656554ba3582078055 to your computer and use it in GitHub Desktop.
A sample of Sinatra + Slim
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
# [Sinatra Recipes - Views - Slim](http://recipes.sinatrarb.com/p/views/slim) | |
# | |
# . | |
# ├── Gemfile | |
# ├── Gemfile.lock | |
# ├── app.rb | |
# └── views/ | |
# ├── index.slim | |
# └── layout.slim | |
require 'sinatra' # http://sinatrarb.com | |
require 'sinatra/reloader' # http://sinatrarb.com/contrib/reloader | |
require 'slim' # http://slim-lang.com | |
get '/' do | |
@message = 'Hello!' | |
slim :index | |
end |
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
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem 'sinatra' | |
gem 'sinatra-contrib' | |
gem 'slim' |
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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
backports (3.15.0) | |
multi_json (1.13.1) | |
mustermann (1.0.3) | |
rack (2.0.7) | |
rack-protection (2.0.5) | |
rack | |
sinatra (2.0.5) | |
mustermann (~> 1.0) | |
rack (~> 2.0) | |
rack-protection (= 2.0.5) | |
tilt (~> 2.0) | |
sinatra-contrib (2.0.5) | |
backports (>= 2.8.2) | |
multi_json | |
mustermann (~> 1.0) | |
rack-protection (= 2.0.5) | |
sinatra (= 2.0.5) | |
tilt (>= 1.3, < 3) | |
slim (4.0.1) | |
temple (>= 0.7.6, < 0.9) | |
tilt (>= 2.0.6, < 2.1) | |
temple (0.8.1) | |
tilt (2.0.9) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
sinatra | |
sinatra-contrib | |
slim | |
BUNDLED WITH | |
2.0.1 |
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
h1 | |
= @message |
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
doctype html | |
html | |
head | |
title | |
| A sample of Sinatra + Slim | |
link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic" | |
link rel="stylesheet" href="https://cdn.rawgit.com/necolas/normalize.css/master/normalize.css" | |
link rel="stylesheet" href="https://cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css" | |
body class="container" | |
== yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment