More Related Content Similar to Rails advantages and techniques (20) Rails advantages and techniques3. • Jan ‘DefV’ De Poorter
• Developer, IT Engineer
• Openminds, #1 Rails Hoster in .be
• blog.defv.be
• Trying to be first on google as Jan 11. • Very readable code
• Implemented documentation system (RDOC)
• Tests makes sure you don’t break anything 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> 27. • No, because
• No more broken builds
• Fix bugs forever
• Think before you implement
• Small steps
• Yes, because
• it takes time to learn 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 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