Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Sinatra::Ftw
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luciano Sousa
September 18, 2010
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sinatra::Ftw
An introduction about Sinatra Framework
Luciano Sousa
September 18, 2010
More Decks by Luciano Sousa
See All by Luciano Sousa
Playing with Sorbet
lucianosousa
0
63
Knowing mina deploy
lucianosousa
1
89
Creating your startup without Developer
lucianosousa
0
190
Patterns Falacy v2
lucianosousa
0
140
Project Management like Software Developer
lucianosousa
1
120
The Patterns Falacy - Rails Version
lucianosousa
1
140
Other Decks in Programming
See All in Programming
R8 の設定見直しでアプリサイズ削減
andpad
0
220
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
ActionController meets Protocol Buffers
sorah
0
580
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
830
気持ちぃ〜角丸 Squircle
ryu1013
0
320
Domain-Driven Transformation
hschwentner
2
2.3k
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
540
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1k
最近”作らせてる” ローカルAIアプリの話
akit37
0
480
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
HDC tutorial
michielstock
2
960
Exploring anti-patterns in Rails
aemeredith
4
540
First, design no harm
axbom
PRO
2
1.3k
Paper Plane
katiecoart
PRO
5
54k
How to make the Groovebox
asonas
2
2.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Side Projects
sachag
456
43k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Leo the Paperboy
mayatellez
10
2.4k
Transcript
http://twitter.com/lucianosousa 1 Sinatra::Ftw Luciano Sousa
[email protected]
http://lucianosousa.net http://twitter.com/lucianosousa http://github.com/lucianosousa
http://twitter.com/lucianosousa 2 Sinatra::WTF? ✔ Micro Framework web ✔ DSL ✔
Rotas ✔ Múltiplos Templates ✔ Filtros ✔ Exemplos
http://twitter.com/lucianosousa 3 Sinatra::Description Micro Framework para desenvolvimento de aplicações web
com o mínimo de esforço.
http://twitter.com/lucianosousa 4 Sinatra::DSL get '/hi' do “hello world!” end Domain
Specific Language
http://twitter.com/lucianosousa 5 Sinatra::Routes get '/' do “get in index” end
post '/' do “post in index” end put '/' do “put in index” end delete '/' do “delete in index” end get '/:name' do “Hello #{params[:name]}!” end
http://twitter.com/lucianosousa 6 Sinatra::Templates get '/' do “hello world!” end get
'/' do erb :index end get '/' do haml :index end get '/' do erubis :index end
http://twitter.com/lucianosousa 7 Sinatra::Layout get '/' do erb :index end Carrega
arquivo arquivo layout.template dentro da pasta views automagicamente
http://twitter.com/lucianosousa 8
http://twitter.com/lucianosousa 9
http://twitter.com/lucianosousa 10
http://twitter.com/lucianosousa 11
http://twitter.com/lucianosousa 12 Sinatra::Helpers helpers do def sum(value) "Result: #{value.to_i+100}" end
end get '/:value' do sum(params[:value]) end Obs: O parâmetro :value é passado como string para o helper.
http://twitter.com/lucianosousa 13
http://twitter.com/lucianosousa 14 Sinatra::Filters after do puts "Response status is: #{response.status}"
end
http://twitter.com/lucianosousa 15
http://twitter.com/lucianosousa 16 Sinatra::Example