SlideShare a Scribd company logo
Ruby On Rails
 BeijingLUG



by Nathaniel Brown
    April 2007
Overview
●
    Install Ruby
●
    Install Rails
●
    (Optional) Install Eclipse
●
    Talk about Ruby
●
    Talk about Rails
●
    Example Application
●
    Links to Resources
Install Ruby
●
    sudo apt-get install ruby irb ri rdoc
●
    If you want to install mongrel you will also have
    to install the dev packages.
●
    sudo apt-get install ruby1.8-dev build-essential
Install Ruby Gems
●
    wget : http://rubyforge.org/frs/download.php/17190/
●
    tar xzvf rubygems-0.9.2.tgz
●
    cd rubygems-0.9.2
●
    sudo ruby setup.rb
●
    cd ..
●
    rm -rf rubygems-0.9.2
Install Rails and Mongrel
●
    sudo gem install rails --include-dependencies
●
    (Optional) sudo gem install mongrel --include-
    dependencies
●
    (Optional) Select the latest version of each
    library.
Install MySQL Server
●
    You could use PostgreSQL or SQLite instead
    but most examples use MySQL so we will as
    well.
●
    sudo apt-get install mysql-server phpmyadmin
    libmysql-ruby apache2 libapache2-mod-php5
(Optional) Install Eclipse
●
    sudo apt-get install eclipse sun-java5-jdk sun-
    java5-fonts
(Optional) Install RDT, RadRails and
       Aptana and Subclipse
●
    Open Eclipse and go to Help ->Software Updates
    -> Find and Install...
●
    Select “Search for new features to install” then
    click on “Next”.
●
    Add the following remote sites:
    RDT : http://updatesite.rubypeople.org/release
    RadRails : http://radrails.sourceforge.net/update
    Aptana : http://update.aptana.com/install/
    Subclipse : http://subclipse.tigris.org/update_1.2.x
●
    Once they have been added install all of them.
(Optional) Config RDT and RadRails
●
    Open Eclipse and go to Windows ->
    Preferences
●
    Find Ruby and add the Ruby interpreter.
●
    Find Rails and add the applications. They
    should all be in /usr/bin/*app name*
Ruby is a nice language
●
    Object Orientated
●
    Automatic garbage collection
●
    Sane readable code that makes sense.
Ruby example code 1
●
    Is readable

    puts "leon".reverse.capitalize

    staff_list = ["joe", "steve", "bob"]
    staff_list.sort!
    staff_list.each do |first_name|
     puts first_name.capitalize
    end

    3.times do |zork| puts "#{zork} " end
Ruby example code 2
−Tells       you if it will change the variable.
my_string = "12345"
new_string = my_string.chop
puts "String chopped."
puts "my_string: #{my_string}"
puts "new_string: #{new_string}"

my_string = "98765"
puts "my_string: #{my_string}"
my_string.chop!
puts "String chopped."
puts "my_string: #{my_string}"

my_number = 999474
puts my_number.to_s.include?("94")

my_string = "This is a test."
puts "#{my_string[3..5]}"
puts "#{my_string[2]}"
my_string[10..13] = "Ruby"
puts my_string
Ruby example code 3

−Lots      of things are just done really nicely.
#create our thread array
threads = []

5.times do |i|
  #create 5 threads into the array        
  threads[i] = Thread.new do
    #wait a random amount of time, then print a message
    sleep(rand(10))
    puts "I am thread number #{i}"
  end
end

#let each thread finish before ending the program
threads.each {|t| t.join}
Rails is a nice Framework
●
    Rapid Application Development
●
    Caching
●
    Model View Controller
●
    Nice informative errors

●
    DRY – Don't Repeat Yourself.
●
    Convention over Configuration
Rails supports modern features
●
    AJAX is build into the framework but JavaScript
    isn't required.
●
    Pretty URLs
●
    Active Record which is a type of Object
    Relation Mapping (ORM)
Rails encourages good
           development practices
●
    Validation
●
    Unit testing
●
    Use of development, testing and production
    environments with sane settings for each of
    them. e.g. Development has caching turned off.
    Production and Testing have it turned on.
●
    Version control is encouraged and assumed.
The Bad
●
    No manual only books.
●
    Ruby is relatively slow. (See Language Shoot-
    out)
●
    Rails is database driven which means it scales
    with the database.
●
    You'll often have to do things the “Rails Way”.
    (But it's often the right way as well)
●
    Lots of the 3rd party libraries are still unstable.
    (Improving quickly)
Create Your First Rails Applications
●
    If you are reading this online then go to the links
    section find RadRail's home page. He has a
    fairly good tutorial using RadRails.
Resources Links
●
    Rails for Fedora -
    http://digitalmediaminute.com/howto/fc4rails/
●
    RDT - http://rubyeclipse.sourceforge.net/
●
    RadRails and Aptana - http://www.radrails.org/
●
    Language Shoot-out -
    http://shootout.alioth.debian.org/
Cheat Sheets Links
●
    Rails, CSS, Javascript, HTML, etc (A4) -
    http://www.ilovejackdaniels.com/
●
    Nice Rails summary -
    http://www.blainekendall.com/index.php/rubyonrails
●
    A couple of Rails Cheat Sheets -
    http://www.slash7.com/goodies
Rails Links
●
    Ruby - http://www.ruby-lang.org/en/
●
    Ruby on Rails - http://www.rubyonrails.org/
●
    Ruby Forge - http://rubyforge.org/
●
    Free Ruby manual - http://www.poignantguide.net/ruby/
●
    Rails and Caching -
    http://www.railsenvy.com/2007/2/28/rails-caching-tutorial
●
    Ruby On Rails to exe -
    http://www.erikveen.dds.nl/distributingrubyapplications/rails.html
●
    Rails Tricks -
    http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-kno
●
    Rails Deployment -
    http://manuals.rubyonrails.com/read/book/17

More Related Content

What's hot

What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
Hiroshi SHIBATA
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
Ngoc Dao
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Adler Hsieh
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
Hiroshi SHIBATA
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to rails
Go Asgard
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
Hiroshi SHIBATA
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
Hiroshi SHIBATA
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
Dennis Ushakov
 
Rango
RangoRango
rsyslog meets docker
rsyslog meets dockerrsyslog meets docker
rsyslog meets docker
Rainer Gerhards
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
Hiroshi SHIBATA
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
olegshpynov
 
WTF Is Rancher?
WTF Is Rancher?WTF Is Rancher?
WTF Is Rancher?
Chris Tankersley
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
Wen-Tien Chang
 
Zap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nkZap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nk
Praveen Kumar
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
Domingo Suarez Torres
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
railsconf
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About Rails
Adam Wiggins
 
How to-node-core
How to-node-coreHow to-node-core
How to-node-core
IsaacSchlueter
 

What's hot (19)

What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
Introduction to rails
Introduction to railsIntroduction to rails
Introduction to rails
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
 
Rango
RangoRango
Rango
 
rsyslog meets docker
rsyslog meets dockerrsyslog meets docker
rsyslog meets docker
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
WTF Is Rancher?
WTF Is Rancher?WTF Is Rancher?
WTF Is Rancher?
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Zap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nkZap api and scripting - @iprav33nk
Zap api and scripting - @iprav33nk
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About Rails
 
How to-node-core
How to-node-coreHow to-node-core
How to-node-core
 

Viewers also liked

Accessing_MySQL_from_Ruby
Accessing_MySQL_from_RubyAccessing_MySQL_from_Ruby
Accessing_MySQL_from_Ruby
tutorialsruby
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorial
tutorialsruby
 
lab56_db
lab56_dblab56_db
lab56_db
tutorialsruby
 
ruby-efl-tutorial-hsyl20
ruby-efl-tutorial-hsyl20ruby-efl-tutorial-hsyl20
ruby-efl-tutorial-hsyl20
tutorialsruby
 
rails.html
rails.htmlrails.html
rails.html
tutorialsruby
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
tutorialsruby
 
wtst3_pettichord3
wtst3_pettichord3wtst3_pettichord3
wtst3_pettichord3
tutorialsruby
 
Difference between flyers, brochures, posters & leaflets
Difference between flyers, brochures, posters & leafletsDifference between flyers, brochures, posters & leaflets
Difference between flyers, brochures, posters & leaflets
Interactive Bees
 

Viewers also liked (8)

Accessing_MySQL_from_Ruby
Accessing_MySQL_from_RubyAccessing_MySQL_from_Ruby
Accessing_MySQL_from_Ruby
 
Devoxx%202008%20Tutorial
Devoxx%202008%20TutorialDevoxx%202008%20Tutorial
Devoxx%202008%20Tutorial
 
lab56_db
lab56_dblab56_db
lab56_db
 
ruby-efl-tutorial-hsyl20
ruby-efl-tutorial-hsyl20ruby-efl-tutorial-hsyl20
ruby-efl-tutorial-hsyl20
 
rails.html
rails.htmlrails.html
rails.html
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
 
wtst3_pettichord3
wtst3_pettichord3wtst3_pettichord3
wtst3_pettichord3
 
Difference between flyers, brochures, posters & leaflets
Difference between flyers, brochures, posters & leafletsDifference between flyers, brochures, posters & leaflets
Difference between flyers, brochures, posters & leaflets
 

Similar to rubyonrails

RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
scandiweb
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the Story
Nathanial McConnell
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
Rafael Rosa
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
Hiroshi SHIBATA
 
The story of language development
The story of language developmentThe story of language development
The story of language development
Hiroshi SHIBATA
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
Arto Artnik
 
20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris
Johan De Wit
 
Puppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven Development
Puppet
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginners
ConFoo
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
Hiroshi SHIBATA
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Udaya Kiran
 
Ruby confhighlights
Ruby confhighlightsRuby confhighlights
Ruby confhighlights
Claire Tran
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
Gourab Mitra
 
Autolab Workshop
Autolab WorkshopAutolab Workshop
Autolab Workshop
Mihir Pandya
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
Hiroshi SHIBATA
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
Brian Sam-Bodden
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
Hiroshi SHIBATA
 

Similar to rubyonrails (20)

RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
SELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the StorySELF - Becoming a Rails Developer - The Rest of the Story
SELF - Becoming a Rails Developer - The Rest of the Story
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris20140408 tdd puppetcamp-paris
20140408 tdd puppetcamp-paris
 
Puppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven DevelopmentPuppet Camp Paris 2014: Test Driven Development
Puppet Camp Paris 2014: Test Driven Development
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Writing a Ruby Gem for beginners
Writing a Ruby Gem for beginnersWriting a Ruby Gem for beginners
Writing a Ruby Gem for beginners
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
Ruby confhighlights
Ruby confhighlightsRuby confhighlights
Ruby confhighlights
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
Autolab Workshop
Autolab WorkshopAutolab Workshop
Autolab Workshop
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 

More from tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
tutorialsruby
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
tutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
tutorialsruby
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
tutorialsruby
 
CSS
CSSCSS
CSS
CSSCSS
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
tutorialsruby
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 

More from tutorialsruby (20)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Recently uploaded

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 

Recently uploaded (20)

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 

rubyonrails

  • 1. Ruby On Rails BeijingLUG by Nathaniel Brown April 2007
  • 2. Overview ● Install Ruby ● Install Rails ● (Optional) Install Eclipse ● Talk about Ruby ● Talk about Rails ● Example Application ● Links to Resources
  • 3. Install Ruby ● sudo apt-get install ruby irb ri rdoc ● If you want to install mongrel you will also have to install the dev packages. ● sudo apt-get install ruby1.8-dev build-essential
  • 4. Install Ruby Gems ● wget : http://rubyforge.org/frs/download.php/17190/ ● tar xzvf rubygems-0.9.2.tgz ● cd rubygems-0.9.2 ● sudo ruby setup.rb ● cd .. ● rm -rf rubygems-0.9.2
  • 5. Install Rails and Mongrel ● sudo gem install rails --include-dependencies ● (Optional) sudo gem install mongrel --include- dependencies ● (Optional) Select the latest version of each library.
  • 6. Install MySQL Server ● You could use PostgreSQL or SQLite instead but most examples use MySQL so we will as well. ● sudo apt-get install mysql-server phpmyadmin libmysql-ruby apache2 libapache2-mod-php5
  • 7. (Optional) Install Eclipse ● sudo apt-get install eclipse sun-java5-jdk sun- java5-fonts
  • 8. (Optional) Install RDT, RadRails and Aptana and Subclipse ● Open Eclipse and go to Help ->Software Updates -> Find and Install... ● Select “Search for new features to install” then click on “Next”. ● Add the following remote sites: RDT : http://updatesite.rubypeople.org/release RadRails : http://radrails.sourceforge.net/update Aptana : http://update.aptana.com/install/ Subclipse : http://subclipse.tigris.org/update_1.2.x ● Once they have been added install all of them.
  • 9. (Optional) Config RDT and RadRails ● Open Eclipse and go to Windows -> Preferences ● Find Ruby and add the Ruby interpreter. ● Find Rails and add the applications. They should all be in /usr/bin/*app name*
  • 10. Ruby is a nice language ● Object Orientated ● Automatic garbage collection ● Sane readable code that makes sense.
  • 11. Ruby example code 1 ● Is readable puts "leon".reverse.capitalize staff_list = ["joe", "steve", "bob"] staff_list.sort! staff_list.each do |first_name| puts first_name.capitalize end 3.times do |zork| puts "#{zork} " end
  • 12. Ruby example code 2 −Tells you if it will change the variable. my_string = "12345" new_string = my_string.chop puts "String chopped." puts "my_string: #{my_string}" puts "new_string: #{new_string}" my_string = "98765" puts "my_string: #{my_string}" my_string.chop! puts "String chopped." puts "my_string: #{my_string}" my_number = 999474 puts my_number.to_s.include?("94") my_string = "This is a test." puts "#{my_string[3..5]}" puts "#{my_string[2]}" my_string[10..13] = "Ruby" puts my_string
  • 13. Ruby example code 3 −Lots of things are just done really nicely. #create our thread array threads = [] 5.times do |i|   #create 5 threads into the array           threads[i] = Thread.new do     #wait a random amount of time, then print a message     sleep(rand(10))     puts "I am thread number #{i}"   end end #let each thread finish before ending the program threads.each {|t| t.join}
  • 14. Rails is a nice Framework ● Rapid Application Development ● Caching ● Model View Controller ● Nice informative errors ● DRY – Don't Repeat Yourself. ● Convention over Configuration
  • 15. Rails supports modern features ● AJAX is build into the framework but JavaScript isn't required. ● Pretty URLs ● Active Record which is a type of Object Relation Mapping (ORM)
  • 16. Rails encourages good development practices ● Validation ● Unit testing ● Use of development, testing and production environments with sane settings for each of them. e.g. Development has caching turned off. Production and Testing have it turned on. ● Version control is encouraged and assumed.
  • 17. The Bad ● No manual only books. ● Ruby is relatively slow. (See Language Shoot- out) ● Rails is database driven which means it scales with the database. ● You'll often have to do things the “Rails Way”. (But it's often the right way as well) ● Lots of the 3rd party libraries are still unstable. (Improving quickly)
  • 18. Create Your First Rails Applications ● If you are reading this online then go to the links section find RadRail's home page. He has a fairly good tutorial using RadRails.
  • 19. Resources Links ● Rails for Fedora - http://digitalmediaminute.com/howto/fc4rails/ ● RDT - http://rubyeclipse.sourceforge.net/ ● RadRails and Aptana - http://www.radrails.org/ ● Language Shoot-out - http://shootout.alioth.debian.org/
  • 20. Cheat Sheets Links ● Rails, CSS, Javascript, HTML, etc (A4) - http://www.ilovejackdaniels.com/ ● Nice Rails summary - http://www.blainekendall.com/index.php/rubyonrails ● A couple of Rails Cheat Sheets - http://www.slash7.com/goodies
  • 21. Rails Links ● Ruby - http://www.ruby-lang.org/en/ ● Ruby on Rails - http://www.rubyonrails.org/ ● Ruby Forge - http://rubyforge.org/ ● Free Ruby manual - http://www.poignantguide.net/ruby/ ● Rails and Caching - http://www.railsenvy.com/2007/2/28/rails-caching-tutorial ● Ruby On Rails to exe - http://www.erikveen.dds.nl/distributingrubyapplications/rails.html ● Rails Tricks - http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-kno ● Rails Deployment - http://manuals.rubyonrails.com/read/book/17