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 intro


Published on

An introduction of Ruby on Rails for non-programmers.

Published in: Technology
  • Be the first to comment

Ruby on rails intro

  1. 1. Ruby on Rails A Basic Introduction for Non-programmers Mason Chang [email_address]
  2. 2. What is it?
  3. 3. <ul><li>+ </li></ul>
  4. 4. Before we start! Let’s talk about…
  5. 5. What is Programming? <ul><li>Make the computer work for you in a systematic way based on pre-defined rules </li></ul><ul><li>The more trivial routines you have, the more powerful the computer can be </li></ul><ul><li>Depending on the level of abstraction, there are high-level and low-level programming languages </li></ul><ul><li>No matter what language you use, there are commonly 5 types of statements </li></ul>
  6. 6. They are.. <ul><li>Calculations => arithmetic or logical operations </li></ul><ul><li>Assignments => set a name to memorize something </li></ul><ul><li>Conditionals => if, unless and cases </li></ul><ul><li>Iterations => do, while, and until loops </li></ul><ul><li>Controls => sending hardware signals </li></ul>
  7. 7. What is Web? <ul><li>A client-server computing model, of which data transmission is based on the request-response protocol (HTTP) </li></ul><ul><li>The packets are sent in text without encryption </li></ul><ul><li>Stateless nature, connection open and close in every request-response cycle </li></ul><ul><li>No request, no response </li></ul>
  8. 8. Ruby
  9. 9. Ruby Language <ul><li>Created by Yukihiro Matsumoto(aka. Matz) in 1993 </li></ul><ul><li>Flexible syntax, make programmers happy </li></ul><ul><li>Dynamic typing, everything is an object </li></ul><ul><li>Support both OOP and FP styles </li></ul><ul><li>Powerful meta-programming capabilities </li></ul><ul><li>Good for constructing DSL </li></ul><ul><li>Encourage software test </li></ul><ul><li>Site: </li></ul>
  10. 10. Rails
  11. 11. Rails Framework <ul><li>Created by David H. Hansson(aka. DHH) in 2004 </li></ul><ul><li>Full stack framework </li></ul><ul><li>MVC design patterns </li></ul><ul><li>Support RESTful architecture </li></ul><ul><li>Convention Over Configuration </li></ul><ul><li>Don’t Repeat Yourself </li></ul><ul><li>Encourage Agile methodology </li></ul><ul><li>Site: </li></ul>
  12. 12. Full Stack <ul><li>Built-in app server </li></ul><ul><li>Model => ActiveRecord </li></ul><ul><li>Controller => ActionController </li></ul><ul><li>View => ActionView </li></ul><ul><li>Mailer => ActionMailer </li></ul><ul><li>Database adapters </li></ul><ul><li>Test cases and fixtures support </li></ul>
  13. 13. Model-View-Controller
  14. 14. Convention Over Configuration <ul><li>Project files layout => all your code goes in app/ => configuration files in config/ => database migrations in db/ => other libraries in lib/ => static resource files in public/ => app test files in test/ </li></ul><ul><li>Naming conventions => table name map to model name => column name map to model attribute name => controller action map to view template </li></ul>
  15. 15. Don’t Repeat Yourself <ul><li>Code generators => generate project => generate model with db migration => generate controller with views </li></ul><ul><li>Handy helper methods => JavaScript helpers => Form helpers </li></ul><ul><li>Sensible core extensions </li></ul><ul><li>Rake automation tasks </li></ul><ul><li>Use plug-ins and gems </li></ul>