Slides

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Slides - Presentation Transcript

    1. Ruby on Rails An Introduction Mark S. Maglana, CompE, MM
    2. Let's get this out of the way... » My name is Mark S. Maglana » Bachelor's Degree in Computer Engineering from the University of San Carlos, Cebu » Master in Management from the University of the Philippines in Mindanao » Computer geek since grade 5 (BASIC, QBASIC) » Suffered through C, assembly in college » Web dude since 1997, started with ASP 1.0 » ASP.Net, PHP (w/ CakePHP) » UML, VB, .Net, C#, Java, Lotus Notes/Domino
    3. “I constantly remind myself that there are multiple ways and numerous technologies [for] solving a single problem, some better than others.” “By being loyal to one technology stack, I am bound to unconsciously make biased decisions, which will ultimately hinder my ability to deliver business value.” - Stephen Chu http://tinyurl.com/zz995
    4. A Programming Language Ruby on Rails A Web Framework built w/ Ruby
    5. Hold it right there, sparky...
    6. This is an introduction, not a tutorial We wont get in-depth with Ruby and Rails (You're too intelligent to be spoon fed) I assume you're familiar with OOP
    7. Ruby » Created by Yukihiro “Matz” Matsumoto in 1993 » A language designed for humans, not compilers » A true Object-Oriented language » Everything you manipulate in Ruby is an object » They all ultimately inherit from a class named Object (Surprise! Surprise!) » Because everything is an object, there's none of that primitive types vs. reference types silliness.
    8. Hello World # The famous Hello World # program is trivial in # Ruby. You don't need: # # * a \"main\" method # * newline escapes # * semicolons # # Here's the code: puts \"Hello World!\" Ruby won't force you to define a class if you don't need to. In such a case, Ruby automatically encloses your statement in an Object instance.
    9. Other Examples door.close if door.is_open? 5.times { puts “Odelay!” } my_text = 'restaurant' exit unless my_text.include? 'rant' animals = ['cat', 'dog', 'fox'] animals.each {|animal| puts animal.capitalize} small_number = 1212123 really_big_number = 1412432423429340234581340234 pretty_number = 12_000_000_000
    10. And here's one more... class Person attr_accessor :name, :age, :sex end person = Person.new person.name = 'Perting E. Soga' person.age = 36 person.sex = 'M' puts person.name # Perting E. Soga puts person.age # 36 puts person.sex #M
    11. Ruby Conventions » Variables starting with $ are Global Variables (ex. $x, $1, $chunky_bacon) » Variables starting with @ are Instance Variables (ex. @width, @x, @y) » Variables starting with @@ are Class Variables (ex. @@brokeback_coding, @@choo_choo) » Variables without prefixes are Local Variables (ex. chicken_noodles, white_flower) » Constants are always capitalized (ex. Time, Array, LuckyPenguin)
    12. Rails » Created by David Heinemeier Hansson in 2003 » A web application framework built using Ruby » Uses the Model-View-Controller (MVC) design pattern » Also uses the ActiveRecord design pattern » Some ex-Java programmers claim Rails helped them develop applications 10x faster
    13. de co Show me the money!
    14. How Rails Works /posts/show/1 1. 9. Web Server Internet 2. 8. show.rhtml posts_controller.rb PostsController::show() view 7. controller 6. post.rb blog_production Post::find(1) 5. 3. model database 4.
    15. Recommended Set-up HTTP mod_proxy Apache 2.2+ Internet mod_proxy_balancer HTTP HTTP HTTP Mongrel Mongrel Mongrel database
    16. Additional Reading » www.ruby-lang.org » www.rubyonrails.org » http://pine.fm/LearnToProgram/ » ruby-phil@googlegroups.com » Google for “OnLAMP Rolling with Rails” » #rubyonrails and #ruby-lang in IRC (freenode) » wiki.rubyonrails.org » api.rubyonrails.org » Agile Web Development book » Programming Ruby book
    17. And we're done!

    + RubyOnRails_dudeRubyOnRails_dude, 3 years ago

    custom

    1306 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1306
      • 1306 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 44
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories