Ruby on Rails
      Eric Berry
      cavneb@gmail.com
      Twitter: @cavneb
      SolidCoreSolutions.com
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Ruby on Rails
Ruby on Rails is an open-source web framework that’s
optimized for programmer happiness and sustainable
prod...
Who uses Rails?
Who uses Rails?
‣ Twitter.com (35 Alexa)
‣ Scribd.com (150)
‣ Hulu.com (224)
‣ Justin.tv (231)
‣ YellowPages.com (641)
‣ C...
Who uses Rails?
‣ Twitter.com (35 Alexa)      “Ruby on Rails is known for its ability to
‣ Scribd.com (150)            bui...
Why use Rails?
Why use Rails?
• Productive within minutes, not weeks.
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Why use Rails?
• Productive within minutes, not weeks.
• Convention over configuration
• 100% object oriented
• Use templat...
Is Ruby on Rails
always the solution?
NO!
Why NOT use Rails?
Why NOT use Rails?
• Not as widely accepted as Tomcat or .NET
Why NOT use Rails?
• Not as widely accepted as Tomcat or .NET
• Not a compiled language
Why NOT use Rails?
• Not as widely accepted as Tomcat or .NET
• Not a compiled language
• Primarily used for web applicati...
Why NOT use Rails?
• Not as widely accepted as Tomcat or .NET
• Not a compiled language
• Primarily used for web applicati...
And now for something
 completely different...
See more at http://railsenvy.com/tags/Commercials
MVC
Model
View
Controller
Model
Object that represents a table column within a database.
View
HTML code that is rendered to the browser.
Controller
Middle man between the views and models.
MVC with Rails
MVC with Rails
     a
     p
     a
     c
     h    Controller
     e
MVC with Rails
     a
            View
     p
     a
     c
     h    Controller
     e


            Model
MVC with Rails
     a
            View
     p
     a
     c
     h    Controller
     e


            Model
MVC with Rails
     a
             View
     p
     a
     c
     h    Routes
     e


           Controller



          ...
MVC with Rails
  a
          View       Helpers
  p
  a
  c
  h    Routes
  e


        Controller



          Model
MVC with Rails
 a



     Rack Middleware
                          View       Helpers
 p
 a
 c
 h                     Rou...
MVC with Rails
 a



     Rack Middleware
                          View       Helpers
 p
 a
 c
 h                     Rou...
Installation
                           Ruby


Pre-packaged with OS X 10.5+




$ yum install ruby irb rdoc
$ apt-get inst...
Installation
                    RubyGems


Download from http://rubygems.org and install




Download from http://rubygem...
Installation
                           Rails


$ sudo gem install rails




$ sudo gem install rails




C:> gem install ...
Create a Rails App
$ rails my_app
Create a Rails App
$ rails my_app
       app     - home of models, views and controllers
    config      - db, deployment, ...
Let’s give away a book!
Upcoming SlideShare
Loading in...5
×

Ruby On Rails

3,486

Published on

Introduction to Ruby on Rails for URUG Rails Workshop 2009

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,486
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
128
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide

Ruby On Rails

  1. 1. Ruby on Rails Eric Berry cavneb@gmail.com Twitter: @cavneb SolidCoreSolutions.com
  2. 2. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.
  3. 3. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.
  4. 4. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration. PHP C# Java Python Zend ASP.net Spring web2py CakePHP Struts Django, CodeIgniter Stripes TurboGears symfony Tapestry Pylons Zoop Hivemind Zope Akelos JBoss Quixote
  5. 5. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration. Ruby PHP C# Java Python Rails Zend ASP.net Spring web2py Sinatra CakePHP Struts Django, Merb* CodeIgniter Stripes TurboGears symfony Tapestry Pylons Zoop Hivemind Zope Akelos JBoss Quixote
  6. 6. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.
  7. 7. Ruby on Rails Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration. “Software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.”
  8. 8. Who uses Rails?
  9. 9. Who uses Rails? ‣ Twitter.com (35 Alexa) ‣ Scribd.com (150) ‣ Hulu.com (224) ‣ Justin.tv (231) ‣ YellowPages.com (641) ‣ CookPad.com (696) ‣ AboutUs.org (761) ‣ UrbanDictionary.com (770) ‣ Spock.com (1689) ‣ Jango.com (2088) ‣ iLike.com (2161) ‣ FunnyOrDie.com (2814)
  10. 10. Who uses Rails? ‣ Twitter.com (35 Alexa) “Ruby on Rails is known for its ability to ‣ Scribd.com (150) build Web applications quickly and with ease. For first-time users of Java, it could ‣ Hulu.com (224) take about five to ten days to build a ‣ Justin.tv (231) moderately useful Web application that will communicate with a database using ‣ YellowPages.com (641) accepted Java Web best-practices such as ‣ CookPad.com (696) separating business logic, from display logic ‣ AboutUs.org (761) (commonly referred to as Model-View- Controller). With no prior training on Ruby ‣ UrbanDictionary.com (770) on Rails, it takes about one day to ‣ Spock.com (1689) accomplish the same goal using the Ruby programming language. In several more ‣ Jango.com (2088) days, it is possible to build a relatively ‣ iLike.com (2161) complete Web application with Ruby on Rails.” ‣ FunnyOrDie.com (2814) http://www.developerfusion.com/column/7092/ruby-on-rails-deserves-the-hype/2/
  11. 11. Why use Rails?
  12. 12. Why use Rails? • Productive within minutes, not weeks.
  13. 13. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration
  14. 14. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented
  15. 15. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc.
  16. 16. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc. • Database persistence with Active Record
  17. 17. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc. • Database persistence with Active Record • Simple AJAX integration
  18. 18. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc. • Database persistence with Active Record • Simple AJAX integration • Enables Agile practices
  19. 19. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc. • Database persistence with Active Record • Simple AJAX integration • Enables Agile practices • Generators
  20. 20. Why use Rails? • Productive within minutes, not weeks. • Convention over configuration • 100% object oriented • Use templates for html, email, xml, etc. • Database persistence with Active Record • Simple AJAX integration • Enables Agile practices • Generators • Community
  21. 21. Is Ruby on Rails always the solution?
  22. 22. NO!
  23. 23. Why NOT use Rails?
  24. 24. Why NOT use Rails? • Not as widely accepted as Tomcat or .NET
  25. 25. Why NOT use Rails? • Not as widely accepted as Tomcat or .NET • Not a compiled language
  26. 26. Why NOT use Rails? • Not as widely accepted as Tomcat or .NET • Not a compiled language • Primarily used for web applications
  27. 27. Why NOT use Rails? • Not as widely accepted as Tomcat or .NET • Not a compiled language • Primarily used for web applications • You can get a false sense of productivity when following the examples. Typical real- world projects are more complex
  28. 28. And now for something completely different...
  29. 29. See more at http://railsenvy.com/tags/Commercials
  30. 30. MVC
  31. 31. Model View Controller
  32. 32. Model Object that represents a table column within a database.
  33. 33. View HTML code that is rendered to the browser.
  34. 34. Controller Middle man between the views and models.
  35. 35. MVC with Rails
  36. 36. MVC with Rails a p a c h Controller e
  37. 37. MVC with Rails a View p a c h Controller e Model
  38. 38. MVC with Rails a View p a c h Controller e Model
  39. 39. MVC with Rails a View p a c h Routes e Controller Model
  40. 40. MVC with Rails a View Helpers p a c h Routes e Controller Model
  41. 41. MVC with Rails a Rack Middleware View Helpers p a c h Routes e Controller Model
  42. 42. MVC with Rails a Rack Middleware View Helpers p a c h Routes e Controller Model
  43. 43. Installation Ruby Pre-packaged with OS X 10.5+ $ yum install ruby irb rdoc $ apt-get install ruby irb rdoc Download 1-Click installer from http://www.ruby-lang.org
  44. 44. Installation RubyGems Download from http://rubygems.org and install Download from http://rubygems.org and install Download from http://rubygems.org and install or make sure that when you install Ruby, you opt ‘Enable RubyGems’
  45. 45. Installation Rails $ sudo gem install rails $ sudo gem install rails C:> gem install rails
  46. 46. Create a Rails App $ rails my_app
  47. 47. Create a Rails App $ rails my_app app - home of models, views and controllers config - db, deployment, environment settings db - migrations and schema doc - rdocs and other documentation lib - custom code and rake tasks log - logs for all environments public - public script - ruby scripts (generate, plugin, etc) test - home for all testing files (unit, functional, etc) tmp - temp folder vendor - home for plugins and gems
  48. 48. Let’s give away a book!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×