Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby on Rails introduction

joren
November 27, 2013

Ruby on Rails introduction

A short walk through Ruby and Rails/

joren

November 27, 2013
Tweet

More Decks by joren

Other Decks in Programming

Transcript

  1. History • 1995 • Yukihiro Matsumoto (aka Matz) • Philosophy:

    Designed for programmer productivity and fun.
  2. 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.”
  3. Duck typing • it walks like a duck; • it

    talks like a duck; • it will probably be a duck.
  4. 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
  5. 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
  6. MVC

  7. 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
  8. $ rake • rake is to ruby what make is

    to C • run little ruby scripts • often used for cronjobs • rake -T
  9. Bundler • gem version management • bundle install rails •

    bundle update rails • bundle exec rails console • Gemfile & Gemfile.lock