Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ruby On Rails Overview


Published on

This is a slide deck that I modified to give some great intro information for people to both Ruby and Ruby on Rails

Published in: Technology
  • Be the first to comment

Ruby On Rails Overview

  1. 1. Ruby on Rails Overview Jon Kinney Avastone Technologies
  2. 2. What is it?
  3. 3. Ruby the Programming Language Rails the Web Framework
  4. 4. Language Framework Ruby Rails C# WebForms C# ASP.NET MVC PHP Zend Java Struts Java Spring MVC
  5. 5. What’s the big deal?
  6. 6. Fun! Easy! Productive!
  7. 7. Why should I care?
  8. 8. Broaden your Horizons
  9. 9. Learn from other frameworks and languages Be a better
  10. 10. What is Ruby?
  11. 11. Object Oriented Java Ruby Python VB.NET C++ C#
  12. 12. Dynamically Typed Not compiled Code is executed at run time
  13. 13. The Ruby Language
  14. 14. The .each Method
  15. 15. Everything’s an objec
  16. 16. Defining methods Everything in ruby is true except nil and false Ruby automatically returns the last statement in a method
  17. 17. The “unless” statement
  18. 18. “if” at the end “else” at the end
  19. 19. Garbage Object Collection Oriented Good Public and IDE’s Private Methods Similar to C#
  20. 20. No curly No braces or Compile- semicolon time s checking Dynamic Interpreted Typing Different from C#
  21. 21. What is Rails?
  22. 22. 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
  23. 23. Model View Controller Framework
  24. 24. Model req ues t Controller res po n se View
  25. 25. All in one! ASP.NET Ruby on Rails MVC Presentation ASP.NET Rails MVC Database migrations T-SQL Rails Data access & LINQ to Rails persistence Entities Unit testing NUnit Rails Testing web pages (?) Rails Testing cookies and (?) Rails session state
  26. 26. Opinionated Software Not Academic Convention over Configuration
  27. 27. Conventions • Singular camel cased model/class names • Plural lower case and underscored • Db table names • Variable names • Method names • Primary key called “id” • Db fields called created_at and updated_at • Get free timestamps when performing
  28. 28. D.R.Y. Don’t Repeat Yourself Each piece of knowledge should have one and only one place to live
  29. 29. An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data. ~ Martin Fowler Active Record
  30. 30. Running Rails
  31. 31. Runs on ….
  32. 32. Store stuff in … And others …
  33. 33. Write code with ….
  34. 34. Walkthrough Creating a Rails Project in 3 Steps
  35. 35. Step 1
  36. 36. They ALL look like
  37. 37. Step 2 (optional) # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000
  38. 38. Step 3 – Boot Mongrel Or use the Passenger Preference Pane for Apache2
  39. 39. Tada!!
  40. 40. DEMO Cookbook