Your SlideShare is downloading. ×
Rails and Merb
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Rails and Merb

1,079
views

Published on

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,079
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide






































































































  • Transcript

    • 1. “Web development that doesn’t hurt” Thursday, February 5, 2009
    • 2. “Faster, Lighter, More Agile” Thursday, February 5, 2009
    • 3. Merb == Rails Merb != Rails Rails << Merb Thursday, February 5, 2009
    • 4. Merb == Rails Thursday, February 5, 2009
    • 5. “Rails is a Model View Controller web framework written in Ruby.” Thursday, February 5, 2009
    • 6. “Merb is a Model View Controller web framework written in Ruby.” Thursday, February 5, 2009
    • 7. merb-gen app blog rails blog Thursday, February 5, 2009
    • 8. Merb != Rails Thursday, February 5, 2009
    • 9. Merb = Mongrel + erb Thursday, February 5, 2009
    • 10. Hey there folks- I'm happy to announce the first useable release of my new pocket- Merb is a mongrel handler with framework Merb. built in controller and view templating with erb. It has a nice routing system similar to rails but much simpler. It uses some of the code from the camping handler and the rails handler and then some of its own secret sauce to form imho a nice fast little framework. -- Ezra Zygmuntowicz, 10-2006 Thursday, February 5, 2009
    • 11. Merb -= Mongrel Merb -= erb Thursday, February 5, 2009
    • 12. Enter Rack “Rack provides an minimal interface between webservers supporting Ruby and Ruby frameworks.” Thursday, February 5, 2009
    • 13. Camping Passenger Ramaze Mongrel Rack Merb Thin Sinatra WEBrick ... ... Handlers Adapters Thursday, February 5, 2009
    • 14. Rails Merb ORM ActiveRecord Pick one! Test framework Test::Unit Don’t care! Template language erb Your choice! JS framework Prototype Whatever! Thursday, February 5, 2009
    • 15. rails The full monty under your fingertips with a single command. Thursday, February 5, 2009
    • 16. actionmailer actionpack activerecord activeresource activesupport rails Thursday, February 5, 2009
    • 17. merb Small core, build your personal stack with available gems. Thursday, February 5, 2009
    • 18. merb-helpers merb-cache merb-mailer merb-assets merb-slices merb-action-args merb-core merb-param-protection merb-exceptions merb-auth-core merb-auth-more merb-auth-slice-password Thursday, February 5, 2009
    • 19. “the framework” merb-helpers merb-cache - Router - Controller merb-mailer merb-assets - Logger - Provide hooks for plugins merb-slices merb-action-args merb-core merb-param-protection merb-exceptions merb-auth-core merb-auth-more merb-auth-slice-password Thursday, February 5, 2009
    • 20. merb-helpers merb-cache merb-mailer merb-assets merb-slices merb-action-args merb-core merb-param-protection merb-exceptions merb-auth-core merb-auth-more merb-auth-slice-password Thursday, February 5, 2009
    • 21. ActionController::Base ActionMailer::Base Thursday, February 5, 2009
    • 22. Merb::AbstractController Merb::Controller Merb::MailController Thursday, February 5, 2009
    • 23. Plugins Thursday, February 5, 2009
    • 24. Gems Thursday, February 5, 2009
    • 25. Rails << Merb Thursday, February 5, 2009
    • 26. rails-core Thursday, February 5, 2009
    • 27. Rails 3 ORM Pick one! Test framework Don’t care! Template language Your choice! JS framework Whatever! Thursday, February 5, 2009
    • 28. Rails 3 ORM Pick one! Test framework Don’t care! Template language Your choice! JS framework Whatever! Thursday, February 5, 2009
    • 29. Rails 3 ORM Pick one! Agnosticism! Test framework Don’t care! Template language Your choice! JS framework Whatever! Thursday, February 5, 2009
    • 30. Public API With tests to ensure it doesn’t magically change overtime! Thursday, February 5, 2009
    • 31. DataMapper Thursday, February 5, 2009
    • 32. SELECT * FROM persons WHERE country = 'NL' Thursday, February 5, 2009
    • 33. SELECT * FROM persons WHERE country = 'NL' AR: Person.find(:all, :conditions => [quot;country = ?quot;, quot;NLquot;]) Thursday, February 5, 2009
    • 34. SELECT * FROM persons WHERE country = 'NL' AR: Person.find(:all, :conditions => [quot;country = ?quot;, quot;NLquot;]) DM: Person.all(:country => quot;NLquot;) Thursday, February 5, 2009
    • 35. SELECT * FROM persons WHERE age BETWEEN 18 AND 21 ORDER BY AGE DESC Thursday, February 5, 2009
    • 36. SELECT * FROM persons WHERE age BETWEEN 18 AND 21 ORDER BY AGE DESC AR: Person.find(:all, :conditions => [quot;age BETWEEN ? AND ?quot;, 18, 21], :order => quot;age DESCquot;) # => :( SQL fragments! Thursday, February 5, 2009
    • 37. SELECT * FROM persons WHERE age BETWEEN 18 AND 21 ORDER BY AGE DESC AR: Person.find(:all, :conditions => [quot;age BETWEEN ? AND ?quot;, 18, 21], :order => quot;age DESCquot;) # => :( SQL fragments! DM: Person.all(:age.gt => 18, :age.lt => 21, :order => [:age.desc]) Thursday, February 5, 2009
    • 38. Nice: “strategic eager loading” 100 zoos; 250 exhibits zoos = Zoo.all zoos.each do |zoo| zoo.exhibits.each do |exhibit| puts quot;Zoo: #{zoo.name}, Exhibit: #{exhibit.name}quot; end end Queries ActiveRecord DataMapper Thursday, February 5, 2009
    • 39. Nice: “strategic eager loading” 100 zoos; 250 exhibits zoos = Zoo.all zoos.each do |zoo| zoo.exhibits.each do |exhibit| puts quot;Zoo: #{zoo.name}, Exhibit: #{exhibit.name}quot; end end Queries 101 ActiveRecord DataMapper Thursday, February 5, 2009
    • 40. Nice: “strategic eager loading” 100 zoos; 250 exhibits zoos = Zoo.all zoos.each do |zoo| zoo.exhibits.each do |exhibit| puts quot;Zoo: #{zoo.name}, Exhibit: #{exhibit.name}quot; end end Queries 101 ActiveRecord 2 DataMapper Thursday, February 5, 2009
    • 41. Associations class Zoo include DataMapper::Resource class Zoo < ActiveRecord::Base belongs_to :owner belongs_to :owner has 1, :cafetaria has_one :cafetaria has n, :animals has_many :animals has n, :donors, :through => Resource has_and_belongs_to_many :donors has n, :zookeepers, :through => :agencies has_many :zookeepers, :through => :agencies end end Thursday, February 5, 2009