Skip to content

Instantly share code, notes, and snippets.

@mattsan
Created July 6, 2019 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattsan/4210646da7e7c9656554ba3582078055 to your computer and use it in GitHub Desktop.
Save mattsan/4210646da7e7c9656554ba3582078055 to your computer and use it in GitHub Desktop.
A sample of Sinatra + Slim
# [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
# 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'
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
h1
= @message
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