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 Rails introduction
Search
joren
November 27, 2013
Programming
0
320
Ruby on Rails introduction
A short walk through Ruby and Rails/
joren
November 27, 2013
Tweet
Share
More Decks by joren
See All by joren
Sock Techtalk
joren
0
280
RubyCamp BE #01
joren
0
110
Git techtalk [dutch]
joren
0
400
Chef and Rails, our story
joren
0
110
Mo.by
joren
0
64
Drupal deployments met Capistrano
joren
2
520
Git Techtalk
joren
3
170
Git
joren
11
1.7k
Other Decks in Programming
See All in Programming
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
900
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
330
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
180
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
820
ゆるい個人開発のススメ
kuroppe1819
10
980
使ってみよう Azure AI Document Intelligence
kosmosebi
2
290
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
270
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Clear Off the Table
cherdarchuk
84
310k
Designing the Hi-DPI Web
ddemaree
276
33k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
Designing for Performance
lara
601
67k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.5k
Ruby is Unlike a Banana
tanoku
96
10k
Agile that works and the tools we love
rasmusluckow
325
20k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Being A Developer After 40
akosma
57
580k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
Gamification - CAS2011
davidbonilla
76
4.6k
Transcript
Ruby (on Rails) PHPBenelux @ Nucleus
• @joren • Openminds • ArrrrCamp
Ruby
History
History • 1995 • Yukihiro Matsumoto (aka Matz) • Philosophy:
Designed for programmer productivity and fun.
History • Inspired by Perl, Smalltalk, Lisp, Python • “I
wanted a scripting language that was more powerful than Perl, and more object-oriented than Python. That's why I decided to design my own language.”
Syntax
Dynamic typing
Strong typing
Duck typing • it walks like a duck; • it
talks like a duck; • it will probably be a duck.
Objects
Objects • Everything is an object • Defined by its
BEHAVIOUR
Objects Even primitive types
Classes - Modules • can be instantiated • object creation
• can inherit • cannot be included • can *not* be instantiated • mixin facility, namespace • no inheritance • can be included in classes and modules
Classes - Modules
Dynamic re-open everything
Dynamic
Dynamic
Variables
Methods
Methods
Strings & numbers
Arrays
Hashes
Loops
Conditions
Stdlib abbrev base64 benchmark bigdecimal cgi cmath coverage csv curses
date dbm debug delegate digest dl drb e2mmap English erb etc extmk fcntl fiddle fileutils find forwardable gdbm getoptlong gserver iconv io/console io/nonblock io/wait ipaddr irb json logger mathn matrix minitest minitest/benchmark minitest/spec mkmf monitor mutex_m net/ftp net/ http net/imap net/pop net/smtp net/telnet nkf objspace observer open- uri open3 openssl optparse ostruct pathname pp prettyprint prime profile profiler pstore psych pty racc racc/parser rake rdoc readline resolv resolv-replace rexml rinda ripper rss rubygems scanf sdbm securerandom set shell shellwords singleton socket stringio strscan sync syslog tempfile test/unit thread thwait time timeout tk tmpdir tracer tsort un uri weakref webrick win32ole xmlrpc yaml zlib
Gems • + 65.000 gems • little code libraries/modules •
gem install twitter
Rails just another gem
History • 37 Signals (Basecamp) • David Heinemeier Hansson (aka
DHH) • July 2004
MVC
Models • persintence-layer • validations • data manipulation methods •
define relations • CRUD
None
Views • templates • html (erb, haml, slim), xml, pdf,
json • custom languages
None
None
Controllers • get, post, patch, put, delete,… • parameter parsing
• session / cookie management
None
REST
generators • rails generate model Product name description:text • rails
generate controller products • rails generate mailer OrderMailer • rails generate migration AddActiveToProducts active:boolean • rails generate scaffold products • ‘rails generate’ to view all possibilities
Migrations • rake db:migrate • rake db:migrate:rollback • rake db:migrate:redo
Migrations
$ rake • rake is to ruby what make is
to C • run little ruby scripts • often used for cronjobs • rake -T
Convention Over Configuration
Sinatra
Sinatra
Development
Ruby Version Management • chruby • rvm
Bundler • gem version management • bundle install rails •
bundle update rails • bundle exec rails console • Gemfile & Gemfile.lock
Bundler
Tests • mini_test, unit_test • RSpec • cucumber • capybara
Run it • Local • bundle exec rails server •
pow.cx
Run it • Online • rack: unicorn, puma, passenger
Deploy • mina • capistrano • cap deploy
Community & Learn
Ruby Tapas
RailsCasts
learn.thoughtbot.com/rails
Ruby Rogues (+parley)
Visit a conference (like ArrrrCamp)
rails girls <3
So…
Ruby makes me happy
Tell a story
Thanks! Let’s have a drink.