Introduction To Rails
-
Upload
eric-gruber -
Category
Technology
-
view
2.379 -
download
0
description
Transcript of Introduction To Rails
IntroductionIntroductionto Ruby on Railsto Ruby on Rails
““Web development Web development
that doesn’t hurt.”that doesn’t hurt.”
Eric J. Gruber
About RubyAbout Ruby
Released in 1995Released in 1995 Open sourceOpen source Available for:Available for:
– WindowsWindows– Mac OS XMac OS X– LinuxLinux
Ruby home: Ruby home: http://www.ruby-lang.org/enhttp://www.ruby-lang.org/en// Try Ruby!: Try Ruby!: http://http://tryruby.hobix.comtryruby.hobix.com
About RubyAbout Ruby Dynamic language, like PHPDynamic language, like PHP Clean syntax, natural wording, easy to readClean syntax, natural wording, easy to read
– C#:C#: public class Hello1 { public static public class Hello1 { public static void Main() void Main() { System.Console.WriteLine("Hello, { System.Console.WriteLine("Hello, World!"); } } World!"); } }
– ASP.NET:ASP.NET: <% HelloWorldLabel.Text = <% HelloWorldLabel.Text = “Hello, World!”; %>“Hello, World!”; %>
– PHP:PHP: <?php print “Hello, World!”; ?> <?php print “Hello, World!”; ?>– Ruby:Ruby: puts “Hello, World!” puts “Hello, World!”
About RubyAbout Ruby
Everything is an object in RubyEverything is an object in Ruby
Images from the book Simply Rails 2 by Patrick Lenz
Who uses Ruby on Rails?Who uses Ruby on Rails?
Other success storiesOther success stories
From ruby-lang.org:From ruby-lang.org:– http://ruby-http://ruby-lang.orglang.org
/en/documentation/success-stories/en/documentation/success-stories
From rubyonrails.org:From rubyonrails.org:– http://http://rubyonrails.orgrubyonrails.org/applications/applications
What is Ruby on Rails?What is Ruby on Rails?
Web framework, powered by Ruby, Web framework, powered by Ruby, extracted from the highly successful extracted from the highly successful project management web application, project management web application, Basecamp. Basecamp. http://http://basecamphq.combasecamphq.com
Framework? What’s that?Framework? What’s that?
A A frameworkframework is a basic conceptual is a basic conceptual structure used to solve or address structure used to solve or address complex issues. This very broad complex issues. This very broad definition has allowed the term to be definition has allowed the term to be used as a buzzword, especially in a used as a buzzword, especially in a software context. software context. – http://http://en.wikipedia.orgen.wikipedia.org/wiki/Framework/wiki/Framework
In other words …In other words …
… … it’s like magic!it’s like magic!
Why should I care?Why should I care?
Easy validationsEasy validations Better separation Better separation
of codeof code– HTML, CSS (views)HTML, CSS (views)– Database, business Database, business
logic (models)logic (models)– User interface, User interface,
application logic application logic (controllers)(controllers)
Works well with Works well with AjaxAjax
Good amount of Good amount of resources available resources available to learnto learn
Easy for designers, Easy for designers, fun for fun for programmersprogrammers
Database agnosticDatabase agnostic
Do more with fewer Do more with fewer resourcesresources
Everything is in its right Everything is in its right placeplace
Embrace your Embrace your constraintsconstraints
Don’t Repeat Don’t Repeat YourselfYourself
Every Rails app Every Rails app has the same file has the same file structurestructure
Image from the book RailsSpace by Michael Hartl and Aurelius Prochazka
DemoDemo
How to get startedHow to get started Use the Ruby on Rails download page:Use the Ruby on Rails download page:
– http://http://rubyonrails.orgrubyonrails.org/download/download, or …, or … Windows users can download InstantRails Windows users can download InstantRails
for the total package:for the total package:– http://http://instantrails.rubyforge.org/wiki/wiki.plinstantrails.rubyforge.org/wiki/wiki.pl
Mac users can download Locomotive for a Mac users can download Locomotive for a quick test run (might need to be updated):quick test run (might need to be updated):– http://http://sourceforge.netsourceforge.net/projects/locomotive//projects/locomotive/
Linux users can … it depends on your Linux users can … it depends on your distrodistro
Sign up free at Sign up free at http://http://herokugarden.comherokugarden.com
Recommended Ruby Recommended Ruby readingreading
Learn to Program, 2Learn to Program, 2ndnd
Edition Edition
– PragProg.comPragProg.com
Programming Ruby 1.9Programming Ruby 1.9– PragProg.comPragProg.com
Great for beginners
A lot more advanced
Recommended Rails Recommended Rails readingreading
Simply Rails 2.0Simply Rails 2.0– Sitepoint.comSitepoint.com
Agile Web Development with Agile Web Development with RailsRails– PragProg.comPragProg.com
Great for beginners
A little bit more
advanced
ResourcesResources Ruby on Rails: Talk (Google Group)Ruby on Rails: Talk (Google Group)
– http://http://groups.google.com/group/rubyonrailsgroups.google.com/group/rubyonrails-talk-talk Railscasts (free Ruby on Rails screencasts)Railscasts (free Ruby on Rails screencasts)
– http://http://railscasts.comrailscasts.com Peep Code (paid Rails-related screencasts)Peep Code (paid Rails-related screencasts)
– http://http://peepcode.compeepcode.com Phusion Passenger (easy deployment Phusion Passenger (easy deployment
module)module)– http://http://www.modrails.comwww.modrails.com
Agile Web Development (plugin central)Agile Web Development (plugin central)– http://http://agilewebdevelopment.comagilewebdevelopment.com//
HostingHosting
http://http://slicehost.comslicehost.com http://railsplayground.comhttp://railsplayground.com http://www.site5.comhttp://www.site5.com http://dreamhost.comhttp://dreamhost.com http://hostgator.comhttp://hostgator.com Web Hosting Services Which Support Web Hosting Services Which Support
Ruby on RailsRuby on Rails (from Rails Wiki) (from Rails Wiki)
Questions?Questions?