Rochester on Rails: Introduction to Rails
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Rochester on Rails: Introduction to Rails

  • 2,198 views
Uploaded on

An entry-level introduction to Rails (circa 1.13) I gave at Rochester on Rails. Covers the history, reasons you may use it in a project, and basic architecture.

An entry-level introduction to Rails (circa 1.13) I gave at Rochester on Rails. Covers the history, reasons you may use it in a project, and basic architecture.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,198
On Slideshare
2,182
From Embeds
16
Number of Embeds
3

Actions

Shares
Downloads
20
Comments
0
Likes
0

Embeds 16

http://jayunit.net 14
http://209.85.135.104 1
http://localhost 1

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. Jason Morrison January 19, 2006 Rochester on Rails Ruby on Rails Sustainable Productivity for Web Application Development
  • 2. History
  • 3. July 2004 David Heineimeier Hansson
  • 4. Extracted from Basecamp
  • 5.  
  • 6. 37signals
  • 7.  
  • 8. Hundreds of contributors Thousands of revisions, tickets, and patches
  • 9. Rails 1.0 December 13, 2005
  • 10.  
  • 11. What is Rails?
  • 12. Full Stack
  • 13. Web Application Framework
  • 14. It’s all Ruby!
  • 15. (okay, except one file)
  • 16. (here it is) database.yml development: adapter: sqlite dbfile: db/dev.db test: adapter: sqlite dbfile: db/test.db production: adapter: sqlite dbfile: db/prod.db
  • 17. Everything else is Ruby!
  • 18. ActiveRecord
  • 19. ActionPack
  • 20. ERb views
  • 21. ActionWebService
  • 22. ActionMailer
  • 23. Unit Testing
  • 24. AJAX Helpers
  • 25. Key Concepts
  • 26. DRY: Don’t Repeat Yourself
  • 27. +
  • 28. Convention over configuration
  • 29. =
  • 30. Less code!
  • 31. Order.hbm.xml 01 <hibernate-mapping> 02 <class name=&quot;models.Order&quot; table=&quot;ORDERS&quot; 03 dynamic-update=&quot;true&quot; dynamic-insert=&quot;false&quot;> 06 <id name=&quot;id&quot; column=&quot;id&quot; type=&quot;java.lang.Long&quot; 07 unsaved-value=&quot;null&quot;> 08 <generator class=&quot;identity&quot;/> 09 </id> 10 <set name=&quot;items&quot; lazy=&quot;false&quot; inverse=&quot;false&quot; 11 cascade=&quot;none&quot; sort=&quot;unsorted&quot;> 12 <key column=&quot;id&quot;/> 13 <one-to-many class=&quot;models.Item&quot;/> 14 </set> 15 <property name=&quot;name&quot; type=&quot;java.lang.String&quot; 16 update=&quot;true&quot; insert=&quot;true&quot; 17 access=&quot;property&quot; column=&quot;name&quot;/> 18 </class> 19 </hibernate-mapping>
  • 32. Order.java 01 public class Order { 02 private Set items; 03 private String name; 04 private Long id; 05 06 public Long getId() { return id;} 07 public void setId(Long id) { this.id = id;} 08 public Set getItems() { return items;} 09 public void setItems(Set items) { this.items = items; } 10 public String getName() { return name; } 11 public void setName(String name) { this.name = name; } 12 }
  • 33. order.rb 01 class Order < ActiveRecord::Base 02 has_many :items 03 end
  • 34. Rails is expressive
  • 35. class Project < ActiveRecord::Base belongs_to :portfolio has_one :project_manager has_many :milestones has_and_belongs_to_many :categories validates_presence_of :name, :description validates_acceptance_of :non_disclosure_agreement validates_uniqueness_of :key end
  • 36. #We’re slashing prices, all books are now half off! Product.find( :all, :conditions => “kind=‘book’” ) do |product| product.price *= 0.5 product.save end
  • 37. Increases Programmer Rails increases programmer…
  • 38. Increases Programmer Rails increases programmerhappiness!
  • 39. How does it fit together?
  • 40. Model View Controller
  • 41. Model View Controller ActiveRecord ActionPack } }
  • 42.  
  • 43. Ready, set, code!