ruby on rails
Download
Skip this Video
Download Presentation
Ruby On Rails

Loading in 2 Seconds...

play fullscreen
1 / 17

Ruby On Rails - PowerPoint PPT Presentation


  • 116 Views
  • Uploaded on

Ruby On Rails. Rebecca Crabb and Blaine Stancill. Ruby. Open-Source Programming Language Created by Yukihiro Matsumoto Blended parts of other languages “I wanted a scripting language that was more powerful than Perl and more object-oriented than Python” Public release in 1995

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Ruby On Rails' - orea


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ruby on rails

Ruby On Rails

Rebecca Crabb and Blaine Stancill

slide2
Ruby
  • Open-Source Programming Language
    • Created by Yukihiro Matsumoto
    • Blended parts of other languages
    • “I wanted a scripting language that was more powerful than Perl and more object-oriented than Python”
  • Public release in 1995
    • Achieved mass acceptance in 2006 with Ruby On Rails
why ruby
Why Ruby?
  • Ruby: puts “Hello World!”
  • Java: threeVeryLongLines.weHopeWork…
  • Perl: #$<!&;
  • Lisp: ((a(((b)))c)))

No, But Really…

ruby vs java
Ruby vs Java

Ruby

Java

The empty program:

Class Test {

public static void main(String[] args){}

}

Basic Getters and Setters

class Circle{

private float radius;

public void setRadius(float radius){

this.radius = radius;

}

public float getRadius(){

return radius;

}

}

  • The empty program:
  • Basic Getters and Setters

class Circle

attr_accessor :radius

end

ruby vs java1
Ruby VS JAVA

Ruby

Java

List:

List<String> languages = new LinkedList<String>();

languages.add(“Java”);

languages.add(“Ruby”);

  • List:

stuff = [ ]

stuff << “Java”, “Ruby”

objects
Objects
  • Everything is an object
      • Does not have primitives like Java
typecasting
TypeCasting

“If it walks like a duck and talks like a duck, it’s a duck!”

  • The “Duck Typing” philosophy
    • Define an object by what it can do, not its type
    • Current set of methods and properties
  • Variable naming
    • var could be a local variable
    • @var is an instance variable
    • $var is a global variable
ruby on rails1
Ruby on Rails
  • Open source web application framework for Ruby
  • Designed for Agile development
  • Released in July 2004
  • In August 2006 Apple announced that it would ship RoR with Mac OS X Leopard
    • Rails provided a purpose for Ruby
  • Rails using Model-View-Controller architecture
philosophy and design
Philosophy and Design
  • Convention over Configuration
    • Naming conventions
      • Class Sale in the model, the corresponding table in database is called sales by default
    • Less Code
  • Don’t Repeat Yourself
  • Scaffolding
    • Automatically create full CRUD support for database table
  • Generators
    • Built in scripts to automatically generate parts of framework
active record
Active Record
  • It’s the M in MVC
  • Handles the automatic mapping of your database tables to your runtime model objects
    • Tables to classes
    • Rows to objects
    • Columns to object attributes
  • Don’t need to see or use SQL
    • But still can if necessary
  • Relational database
database access
Database Access
  • team.rb is our model:

class Team < ActiveRecord::Base

has_many :players

has_one :coach

belongs_to :conference

end

  • Retrieve all the players:

@team= Team.find_by_school_and_sport(“unc”,”basketball”)

@team.players

the rails way
The Rails way
  • Quick and easy development
  • Built for scalability
  • Every app is structured the same
  • Convention over Configuration
  • Don’t Repeat Yourself
more info on ror
More Info ON RoR
  • http://www.ruby-lang.org/en/about/
  • http://rubyonrails.org/
  • http://onlamp.com/pub/a/onlamp/2005/10/13/what_is_rails.html?page=3
  • http://railstutorial.org/chapters/a-demo-app
references
References
  • http://www.ruby-lang.org/en/about/
  • http://rubyonrails.org/
  • http://onlamp.com/pub/a/onlamp/2005/10/13/what_is_rails.html?page=3
  • http://railstutorial.org/chapters/a-demo-app
  • http://slideshare.net/Belighted/ruby-vs-java
  • http://slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucks
  • http://en.wikipedia.org/wiki/Diamond_problem
ad