Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby on the Web
Search
Diego Guerra Suárez
March 06, 2015
Programming
73
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby on the Web
Slides from the second day of the ruby@uniovi workshop
Diego Guerra Suárez
March 06, 2015
More Decks by Diego Guerra Suárez
See All by Diego Guerra Suárez
Reruby: Automated refactoring with Ruby
dgsuarez
0
180
Programas que se entienden a sí mismos
dgsuarez
0
92
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
190
Ruby Basics
dgsuarez
0
82
Other Decks in Programming
See All in Programming
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
500
テーブルをDELETEした
yuzneri
0
150
MySQLとPostgreSQLって何が違うの?
akagami
0
120
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
330
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
530
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
820
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
110
AIを紡ぐPMのお話
swdtkuy
0
120
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
110
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
160
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.8k
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
520
Rails Girls Zürich Keynote
gr2m
96
14k
Skip the Path - Find Your Career Trail
mkilby
1
190
HDC tutorial
michielstock
2
790
Speed Design
sergeychernyshev
33
2k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Statistics for Hackers
jakevdp
799
230k
Scaling GitHub
holman
464
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
210
Transcript
Ruby on the web Ruby: from 0 to 100 in
14400 seconds (2) ruby@uniovi: Introducing the Ruby programming language School of Computer Sciences University of Oviedo March 2015
Git
git clone REPO_URL # make changes… git status git commit
-am “Commit message” git push
cd /vagrant/projects/jukebox-sinatra git pull #updates repo state git checkout workshop
#switches branch Let’s type!
git config --global user.email "
[email protected]
" git config --global user.name "user
random"
TIP: Use it in your thesis always ;) https://education.github.com
Tests
“Code without tests is bad code. ” - Michael C.
Feathers Working Effectively with Legacy Code
Unit Tests Integration Tests Acceptance Tests Smoke / Mutation /
Stress TDD / BDD
TIP: Use it in your thesis always ;) http://betterspecs.org/
Web Dev
None
None
None
Blocks
some_method do |param| param * 2 end
Sinatra
Time to code! Exercise #0 Hello, world! @ Sinatra https://trello.com/b/ziGtcloe/day-2-user-stories
None
ERB
<ul> <% @artists.each do |artist| %> <li><%= artist.name %></li> <%
end %> </ul>
html = “<ul>” @artists.each do |artist| html << “<li>” html
<< artist.name html << “</li>” end html << “</ul>”
get “/” do erb :”home/show” end
None
None
None
Persistence
None
class Artist include Mongoid::Document field :name, :type => String embeds_many
:songs end
> a = Artist.create(:name => “Billy Strayhorn”) #=> #<Artist …
name: “Billy Strayhorn”>
> Artist.where(:name => “Duke Ellington”).first #=> #<Artist … name: “Duke
Ellington”>
post “/artist” do artist = Artist.create(params) redirect “/artists” end
None
Heroku
None
$ heroku login $ heroku create $ bin/set_mongolab_in_heroku $ git
push heroku workshop:master $ heroku logs -t
& Rails?
To learn more...
None
https://github.com/ruby-uniovi
Happy hacking! :-) Tw: @pablorc @varezhh @dg_suarez @dcarral