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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Diego Guerra Suárez
March 06, 2015
Programming
69
0
Share
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
170
Programas que se entienden a sí mismos
dgsuarez
0
89
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
180
Ruby Basics
dgsuarez
0
80
Other Decks in Programming
See All in Programming
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.4k
存在論的プログラミング: 時間と存在を記述する
koriym
5
810
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
AIエージェントで業務改善してみた
taku271
0
490
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
300
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
170
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
970
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
160
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
130
おれのAgentic Coding 2026/03
tsukasagr
1
140
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
iOS機能開発のAI環境と起きた変化
ryunakayama
0
160
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
WCS-LA-2024
lcolladotor
0
520
GraphQLとの向き合い方2022年版
quramy
50
14k
How to train your dragon (web standard)
notwaldorf
97
6.6k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
310
Music & Morning Musume
bryan
47
7.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
AI: The stuff that nobody shows you
jnunemaker
PRO
4
520
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
A Soul's Torment
seathinner
5
2.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
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