Rails advantages and techniques

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

    7 Favorites & 2 Groups

    Rails advantages and techniques - Presentation Transcript

    1. Rails advantages and techniques
    2. Person.find_by_name ‘Jan’
    3. • Jan ‘DefV’ De Poorter • Developer, IT Engineer • Openminds, #1 Rails Hoster in .be • blog.defv.be • Trying to be first on google as Jan
    4. Ruby on Rails
    5. Ruby on Rails it does scale
    6. • Framework based on Ruby • Fast, agile development • www.rubyonrails.com
    7. So... Why ? “I already know PHP/.NET/...”
    8. Fast Development
    9. • CRUD • Scaffolding (if you really need to) • DRY • AJAX • acts_as_something
    10. Maintainable
    11. • Very readable code • Implemented documentation system (RDOC) • Tests makes sure you don’t break anything
    12. Model View Controller
    13. Model View Controller • Interface to the database • Business Logic goes here • For the DataBase Admin class User < ActiveRecord::Base has_many :tasks end class Task < ActiveRecord::Base belongs_to :user end
    14. Model View Controller • Link between DB (model) and User (view) • HTTP / Sessions / Cookies / Post / Get • For the Developer class TaskController < ApplicationController def index @tasks = User.find(session[:user_id]).tasks end end
    15. Model View Controller • Web Interface • What the client sees • For the Designer ... <body> <% @tasks.each do |task| %> <div class=’task’> <%= task.content %> is <%= task.status %> </div> <% end %> </body>
    16. Testing
    17. Test-Driven Development
    18. Test-Driven Development • Write tests first
    19. Test-Driven Development • Write tests first • FAIL
    20. Test-Driven Development • Write tests first • FAIL • Implement
    21. Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED
    22. Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED • Clean Up
    23. Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED • Clean Up • Check-In to Version Management
    24. that seems more work?
    25. no
    26. no (but..)
    27. • No, because • No more broken builds • Fix bugs forever • Think before you implement • Small steps • Yes, because • it takes time to learn
    28. Not only for developers!
    29. def test_if_layout_elements_are_present assert_select “body” do assert_select “div.task”, :count => 3 do assert_select “ul” do assert_select “li”, :count => 3 end end end end
    30. is that all ?
    31. No!
    32. polymorphism No!
    33. polymorphism 20.minutes.ago No!
    34. polymorphism 20.minutes.ago 1.gigabyte No!
    35. polymorphism 20.minutes.ago 1.gigabyte No! time_ago_in_words
    36. polymorphism 20.minutes.ago 1.gigabyte No! prototype time_ago_in_words
    37. polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! prototype time_ago_in_words
    38. polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! cache prototype time_ago_in_words
    39. polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! routes cache prototype time_ago_in_words
    40. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! routes cache prototype time_ago_in_words
    41. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte No! routes cache prototype time_ago_in_words
    42. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte No! routes cache prototype delegate time_ago_in_words
    43. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte No! routes group_by cache prototype delegate time_ago_in_words
    44. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte No! routes find_by_sql group_by cache prototype delegate time_ago_in_words
    45. link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte REST No! routes find_by_sql group_by cache prototype delegate time_ago_in_words
    46. titleize link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte REST No! routes find_by_sql group_by cache prototype delegate time_ago_in_words
    47. titleize link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte REST No! routes ... find_by_sql group_by cache prototype delegate time_ago_in_words
    48. Q &A Examples? Discussion Thank you for listening Jan De Poorter - Openminds

    + DefVDefV, 3 years ago

    custom

    4975 views, 7 favs, 4 embeds more stats

    Introduction to rails, and much used techniques, I more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 4975
      • 4884 on SlideShare
      • 91 from embeds
    • Comments 0
    • Favorites 7
    • Downloads 214
    Most viewed embeds
    • 86 views on http://www.openminds.be
    • 2 views on http://www.lonerunners.net
    • 2 views on http://railsfromzero.blogspot.com
    • 1 views on http://64.233.183.104

    more

    All embeds
    • 86 views on http://www.openminds.be
    • 2 views on http://www.lonerunners.net
    • 2 views on http://railsfromzero.blogspot.com
    • 1 views on http://64.233.183.104

    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