• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Rails advantages and techniques
 

Rails advantages and techniques

on

  • 10,009 views

Introduction to rails, and much used techniques, I presented at barcampbrussels

Introduction to rails, and much used techniques, I presented at barcampbrussels

Statistics

Views

Total Views
10,009
Views on SlideShare
9,799
Embed Views
210

Actions

Likes
7
Downloads
255
Comments
0

20 Embeds 210

http://www.openminds.be 86
http://railsfromzero.blogspot.com 79
http://www.slideshare.net 16
http://railsfromzero.blogspot.ru 4
http://railsfromzero.blogspot.com.es 4
http://railsfromzero.blogspot.nl 2
http://railsfromzero.blogspot.ca 2
http://railsfromzero.blogspot.com.br 2
http://railsfromzero.blogspot.in 2
http://railsfromzero.blogspot.com.ar 2
http://www.lonerunners.net 2
http://railsfromzero.blogspot.fr 1
http://railsfromzero.blogspot.ro 1
http://railsfromzero.blogspot.de 1
http://railsfromzero.blogspot.co.uk 1
http://railsfromzero.blogspot.mx 1
http://railsfromzero.blogspot.com.au 1
http://64.233.183.104 1
http://translate.googleusercontent.com 1
http://railsfromzero.blogspot.jp 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Rails advantages and techniques Rails advantages and techniques Presentation Transcript

    • Rails advantages and techniques
    • Person.find_by_name ‘Jan’
    • • Jan ‘DefV’ De Poorter • Developer, IT Engineer • Openminds, #1 Rails Hoster in .be • blog.defv.be • Trying to be first on google as Jan
    • Ruby on Rails
    • Ruby on Rails it does scale
    • • Framework based on Ruby • Fast, agile development • www.rubyonrails.com
    • So... Why ? “I already know PHP/.NET/...”
    • Fast Development
    • • CRUD • Scaffolding (if you really need to) • DRY • AJAX • acts_as_something
    • Maintainable
    • • Very readable code • Implemented documentation system (RDOC) • Tests makes sure you don’t break anything
    • Model View Controller
    • 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
    • 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
    • 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>
    • Testing
    • Test-Driven Development
    • Test-Driven Development • Write tests first
    • Test-Driven Development • Write tests first • FAIL
    • Test-Driven Development • Write tests first • FAIL • Implement
    • Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED
    • Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED • Clean Up
    • Test-Driven Development • Write tests first • FAIL • Implement • SUCCEED • Clean Up • Check-In to Version Management
    • that seems more work?
    • no
    • no (but..)
    • • No, because • No more broken builds • Fix bugs forever • Think before you implement • Small steps • Yes, because • it takes time to learn
    • Not only for developers!
    • 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
    • is that all ?
    • No!
    • polymorphism No!
    • polymorphism 20.minutes.ago No!
    • polymorphism 20.minutes.ago 1.gigabyte No!
    • polymorphism 20.minutes.ago 1.gigabyte No! time_ago_in_words
    • polymorphism 20.minutes.ago 1.gigabyte No! prototype time_ago_in_words
    • polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! prototype time_ago_in_words
    • polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! cache prototype time_ago_in_words
    • polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! routes cache prototype time_ago_in_words
    • link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many 1.gigabyte No! routes cache prototype time_ago_in_words
    • link_to_remote polymorphism 20.minutes.ago has_and_belongs_to_many <%= debug object %> 1.gigabyte No! routes cache prototype time_ago_in_words
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • Q &A Examples? Discussion Thank you for listening Jan De Poorter - Openminds