O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Intro to Ruby on Rails

986 visualizações

Publicada em

Introduction to Ruby on Rails talk that I gave a local .NET users group meeting.

Publicada em: Tecnologia
  • Login to see the comments

  • Seja a primeira pessoa a gostar disto

Intro to Ruby on Rails

  1. 1. Intro to Ruby and Rails Jon Homan
  2. 2. Agenda ● Ruby ● General Properties ● Syntax Examples ● Rules to Remember ● Rails ● Philosophy ● Resources
  3. 3. Ruby
  4. 4. General Properties ● Dynamic ● Interpreted ● Focus ● Simplicity ● Productivity ● Developer Happiness ● Principle of Least Surprise
  5. 5. Consistent API Adapted from Brian Hogan's Intro to Ruby talk ● ”Jon”.length ● [”jon”, ”homan”, ”ruby”, ”rails”].length ● {'a' => 1, 'b' => 2}.length ● User.find_all().length
  6. 6. Syntax Examples Interactive Ruby (irb)
  7. 7. Rules to Remember Adapted from ”Intro to Ruby”
  8. 8. Rules to Remeber 1. Everything is an object 25.class #Fixnum ”jon”.class #String
  9. 9. Rules to Remember 2. Everything is true except nil or false n = 1 puts n if n  #1 n = nil puts n if n  #nil n = false puts n if n #nil
  10. 10. Rules to Remember 3. Variables are dynamically typed, but data is  strongly typed name = ”Jon” number = 42 puts name + number #TypeError: can't convert Fixnum into String puts name + number.to_s #Jon42
  11. 11. Rules to Remember 4. Every method implicity returns the last statement def message   if user     ”Welcome!”   else     ”You need to log in”   end end
  12. 12. Rules to Remember 5. Classes are objects Wrong     person = new Person Correct     person = Person.new
  13. 13. Rails
  14. 14. Philosophy ● Convention over Configuration ● DRY ● REST
  15. 15. Overview ● MVC ● TATFT ● Developer Happiness and Productivity ● “Opinionated Software” ● Full stack
  16. 16. Out of the Box ● WEBrick – simple web server ● Rake – build system ● Scaffolding – CRUD operations ● Prototype and Script.aculo.us ● Libraries through rubygems
  17. 17. Event Registration
  18. 18. Resources Brian Hogan's talk: http://tinyurl.com/introruby Rails Guides: http://guides.rubyonrails.org/ C# vs. Ruby: http://tinyurl.com/c­vsruby Railscasts: http://railscasts.com/ IronRuby: http://ironruby.net/ Ruby from X Lang: http://tinyurl.com/rubyfromx

×