density!"!




Ruby on Rails
An Historical Introduction




Cleveland Web Sig                   June 19, 2010
Overview
Joe Fiorini
Rails Developer, Technology Evangelist, Husband, Dog
Lover
density!"!
Goals
Why to use Rails?
What’s Ruby and what’s Rails?
How does Rails make developers happy?
Where do I go for more informa...
Assumptions
Assumptions
Basic HTTP knowledge
Assumptions
Basic HTTP knowledge
Basic object-oriented principles
Assumptions
Basic HTTP knowledge
Basic object-oriented principles
Dynamic web development
Assumptions
Basic HTTP knowledge
Basic object-oriented principles
Dynamic web development
SQL
#websigrails
For the Twits
Core Philosophy
DRY
Don’t Repeat Yourself
Convention Over Configuration
Get Started Faster!
REST
Your Application as an API
MVC
Model
Data Tier
View
Displayed to the user
Controller
Tying the model and view together
“
I'm trying to make Ruby natural,
not simple.



                     Yukihiro “Matz” Matsumoto
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
ActionPack
ActiveModel
ActionMailer
ActiveResource


ActiveSupport

Railties
Life of a Request
http://www.densitypop.com/
ActionPack




             ActionDispatch
ActionPack



    Blog3::Application.routes.draw do |map|

     root :to => "posts#index"

    end
ActionPack




             ActionDispatch
ActionPack
 ActionDispatch
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch



       class PostsController < ApplicationController

        def index
         @posts = P...
ActionPack
  ActionDispatch                                   Inheritence

       class PostsController < ApplicationContr...
ActionPack
  ActionDispatch
                               Instance Method

             class PostsController < Applicati...
ActionPack
  ActionDispatch
                            Instance Variable (field/private variable)

             class Post...
ActionPack
  ActionDispatch
                    Class                   Class method (static)

             class PostsCon...
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch   ActionController
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveRecord




                  SQLite/
                  MySQL/
               PostgreSQL/…
ActiveRecord

                    SQLite/
                    MySQL/
                   MongoDB/…




                    ...
ActiveRecord

               SQLite/
               MySQL/
              MongoDB/…




                  posts
          i...
ActiveRecord




    class Post < ActiveRecord::Base
    end
ActiveRecord



    post.title
    post.body
    post.id

    post.save
    post.destroy
ActiveRecord




    Post.find_by_title "Awesomest post ever!"

    SELECT * FROM posts WHERE title = 'Awesomest post ever!'
ActiveRecord




    Post.where("title = 'Awesomest post ever!'")

    SELECT * FROM posts WHERE title = 'Awesomest post e...
ActiveRecord



    Post.joins(:authors).where("authors.name = 'Joe'")

    SELECT * FROM posts INNER JOIN authors ON
    ...
ActiveRecord



    Post.find_by_title "Awesomest post ever!"

    vs.
    Post.where("title = 'Awesomest post ever!'")
ActiveRecord
    class CreatePosts < ActiveRecord::Migration
     def self.up
       create_table :posts do |t|
        t....
ActiveRecord


    Validations
      validates_presence_of
      validates_uniqueness_of
      validates_format_of
      v...
ActiveRecord




    http://guides.rails.info
    RTFM
ActiveModel
  ActionDispatch             ActionController




       class Post < ActiveRecord::Base
       end
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch   ActionController

                   ActiveRecord
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch             ActionController

                             ActiveRecord

       <ol>

        ...
ActionPack
  ActionDispatch             Iterator (for loop)
                              ActionController

              ...
ActionPack
Block (anonymous function)
  ActionDispatch             ActionController

                             ActiveRe...
ActionPack
  ActionDispatch             ActionController

                             ActiveRecord


Helper method
    <o...
ActionPack
  ActionDispatch             ActionController

                             ActiveRecord


Helper method
    <o...
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch   ActionController   ActionView

                   ActiveRecord


       <html>
       ...
  ...
http://densitypop.com/posts/22
ActionPack




             ActionDispatch
ActionPack



    Blog3::Application.routes.draw do |map|

     resources :posts

    end
GET /posts/new
Post#new
POST /posts
Post#create
GET /posts/edit/22
Post#edit
PUT /post/22
Post#update
GET /posts/22
Post#show
DELETE /posts/22
Post#destroy
ActionPack




             ActionDispatch
ActionPack
 ActionDispatch
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch




      class PostsController < ApplicationController

        def show
         @post = Pos...
ActionPack
  ActionDispatch

 Request Parameter Hash

       class PostsController < ApplicationController

        def sh...
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch   ActionController
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch             ActionController




       class Post < ActiveRecord::Base
       end
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch   ActionController

                   ActiveRecord
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch            ActionController

                            ActiveRecord




       <h1><%= link_...
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch   ActionController   ActionView

                   ActiveRecord


       <html>
       ...
  ...
http://densitypop.com/feed.xml
ActionPack




             ActionDispatch
ActionPack



    Blog3::Application.routes.draw do |map|

     match 'feed.xml', :to => 'posts#index'

    end
ActionPack




             ActionDispatch
ActionPack
 ActionDispatch
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch


      class PostsController < ApplicationController
       respond_to :xml

        def inde...
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch   ActionController
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch             ActionController




       class Post < ActiveRecord::Base
       end
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch   ActionController

                   ActiveRecord
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch              ActionController

                              ActiveRecord


       atom_feed d...
http://densitypop.com/posts.json
ActionPack




             ActionDispatch
ActionPack



    Blog3::Application.routes.draw do |map|

     resources :posts

    end
ActionPack




             ActionDispatch
ActionPack
 ActionDispatch
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch


      class PostsController < ApplicationController
       respond_to :xml, :json

        d...
ActionPack
  ActionDispatch




                   ActionController
ActionPack
  ActionDispatch   ActionController
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch             ActionController




       class Post < ActiveRecord::Base
       end
ActiveModel
  ActionDispatch         ActionController




                   ActiveRecord
ActiveModel
  ActionDispatch   ActionController

                   ActiveRecord
ActionPack
  ActionDispatch         ActionController

                         ActiveRecord




                   ActionV...
ActionPack
  ActionDispatch                 ActionController

                                 ActiveRecord




       [Th...
There you go.
Isn’t that easy?
Digging Deeper
Nothing is Sacred
Anything can be overridden
Not all magic
Some illusions too
Enterprise Ready
http://www.workingwithrails.com/high-profile-organisations
http://bit.ly/websigrailslinks
Resources


            http://bit.ly/websigrailslinks
Cleveland Ruby Brigade
http://www.meetup.com/ClevelandRuby




                         http://bit.ly/websigrailslinks
Agile Web Dev. with Rails
http://pragprog.com/titles/rails4/




                              http://bit.ly/websigrailsli...
Rails 3 in Action
http://www.manning.com/katz/




                          http://bit.ly/websigrailslinks
http://bit.ly/websigrailslinks
The End
http://speakerrate.com/joefiorini
Please rate this talk (only if it’s good)!
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
An Introduction to Ruby on Rails
Upcoming SlideShare
Loading in...5
×

An Introduction to Ruby on Rails

2,727

Published on

Which ORM (Object-relational mapping) library should I use? What should I use for my template language? Should I use MVC (Model/View/Controller) or some other pattern? What unit testing framework should I use? What database engine should I use?

Unfortunately, these questions make it difficult to start web projects. Therefore, Ruby on Rails has made all of these decisions already; you can just get started. And it's extensible enough that if one of the default choices doesn't work for you, just choose a different library. How does Ruby on Rails answer these questions? How does it use the Ruby language to help make your development even faster? Come and find out!

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,727
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
62
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • TAKE IT SLOW
    Pause after topics
    Take some deep breaths
    Walk to other side of projector when pausing


  • Within3
  • - Ecommerce Sites on Shopify
    - iPad/iPhone R&amp;D
    - Consulting
  • - Ecommerce Sites on Shopify
    - iPad/iPhone R&amp;D
    - Consulting



  • If I throw out a term that you don&amp;#x2019;t understand, please feel free to ask!
  • If I throw out a term that you don&amp;#x2019;t understand, please feel free to ask!
  • If I throw out a term that you don&amp;#x2019;t understand, please feel free to ask!
  • If I throw out a term that you don&amp;#x2019;t understand, please feel free to ask!



  • Write once, use everywhere
    Code is easier to consume
    Easier to edit later


  • How many have not used MVC?

    It&amp;#x2019;s up to you to architect and organize your code in those tools. Rails makes that decision for you by implementing MVC.

  • Code driving the UI that gets displayed to the user
  • Interacts with model and sends the data to the view
  • - Open source framework for developing web applications
    - Created by David Heinemeier Hansson
    - 1.0 was an extremely opinionated framework
    - 3.0 allows you to change many of the opinions
    &amp;#x2026;Written in the language
  • - Everything has a type, but the language infers types at runtime instead of you specifying them up front



  • Remembering names is not important; knowing how the pieces fit together &amp; interact is



  • Utility collection and standard Ruby core extensions used both by Rails itself and your application
  • The glue; ties together framework libraries and 3rd party plugins
  • Build an application through the life of an HTTP request
  • - List 10 most recent posts, newest first





  • ...since for most of you this is your first time seeing Ruby code, let&amp;#x2019;s look at this a little bit


  • any instance variables in a controller are automatically handed into the view
  • ...since for most of you this is your first time seeing Ruby code, let&amp;#x2019;s look at this a little bit



  • ActiveRecord is....
    Default option, but you can use any ORM that implements ActiveModel



  • Inheriting from ActiveRecord::Base does some pretty cool things for us
  • Because I have a class called Post AR knows to look up...

    it also gives us some more time saving methods like...



  • find_by_title will call SQL right away
    .where (and other query methods) will delegate the SQL call to the first time the array is used
  • Way to go forward and backwards between versions of your database


  • We didn&amp;#x2019;t have to write a single line of data access code





  • &amp;#x2026;here&amp;#x2019;s some more strange Ruby syntax


  • this helper method generates the html for a link
  • this helper method generates the html for a link






  • &amp;#x2026;this generates a number of helpful routes for us









  • ...since for most of you this is your first time seeing Ruby code, let&amp;#x2019;s look at this a little bit
  • params[:id] comes from resources route



  • ActiveRecord is....
    Default option, but you can use any ORM that implements ActiveModel
  • We still haven&amp;#x2019;t written a single line of data access code





  • &amp;#x2026;here&amp;#x2019;s some more strange Ruby syntax






  • &amp;#x2026;this generates a number of helpful routes for us



  • ...since for most of you this is your first time seeing Ruby code, let&amp;#x2019;s look at this a little bit



  • ActiveRecord is....
    Default option, but you can use any ORM that implements ActiveModel
  • We still haven&amp;#x2019;t written a single line of data access code





  • With builder all of our block parameters become parent XML tags and all of our method calls child tags; we define attributes by passing a hash to a tag method

    &amp;#x2026;what if we wanted to enable easy Javascript interaction?


  • &amp;#x2026;this generates a number of helpful routes for us



  • ...since for most of you this is your first time seeing Ruby code, let&amp;#x2019;s look at this a little bit



  • ActiveRecord is....
    Default option, but you can use any ORM that implements ActiveModel
  • We still haven&amp;#x2019;t written a single line of data access code





  • respond_with tells ActionController to format the object if it can

    Rails can convert any object into JSON

  • We&amp;#x2019;ve barely scratched the surface of what Rails can do.
  • Convention is very powerful, but sometimes it makes sense to override the defaults
  • Rails gets most of its flexibility from the Ruby language. Uses &amp;#x201C;metaprogramming&amp;#x201D; to generate code at runtime. Optimized for the best of productivity &amp; performance.
  • You&amp;#x2019;d be surprised to see who&amp;#x2019;s using Rails.
  • Highly recommend some further reading to get a better feel for how you can make Rails work for you.



  • ...in case you missed it


  • An Introduction to Ruby on Rails

    1. 1. density!"! Ruby on Rails An Historical Introduction Cleveland Web Sig June 19, 2010
    2. 2. Overview
    3. 3. Joe Fiorini Rails Developer, Technology Evangelist, Husband, Dog Lover
    4. 4. density!"!
    5. 5. Goals Why to use Rails? What’s Ruby and what’s Rails? How does Rails make developers happy? Where do I go for more information?
    6. 6. Assumptions
    7. 7. Assumptions Basic HTTP knowledge
    8. 8. Assumptions Basic HTTP knowledge Basic object-oriented principles
    9. 9. Assumptions Basic HTTP knowledge Basic object-oriented principles Dynamic web development
    10. 10. Assumptions Basic HTTP knowledge Basic object-oriented principles Dynamic web development SQL
    11. 11. #websigrails For the Twits
    12. 12. Core Philosophy
    13. 13. DRY Don’t Repeat Yourself
    14. 14. Convention Over Configuration Get Started Faster!
    15. 15. REST Your Application as an API
    16. 16. MVC
    17. 17. Model Data Tier
    18. 18. View Displayed to the user
    19. 19. Controller Tying the model and view together
    20. 20. “ I'm trying to make Ruby natural, not simple. Yukihiro “Matz” Matsumoto
    21. 21. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    22. 22. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    23. 23. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    24. 24. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    25. 25. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    26. 26. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    27. 27. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    28. 28. ActionPack ActiveModel ActionMailer ActiveResource ActiveSupport Railties
    29. 29. Life of a Request
    30. 30. http://www.densitypop.com/
    31. 31. ActionPack ActionDispatch
    32. 32. ActionPack Blog3::Application.routes.draw do |map| root :to => "posts#index" end
    33. 33. ActionPack ActionDispatch
    34. 34. ActionPack ActionDispatch
    35. 35. ActionPack ActionDispatch ActionController
    36. 36. ActionPack ActionDispatch class PostsController < ApplicationController def index @posts = Post.order("created_at DESC"). limit(10) end end
    37. 37. ActionPack ActionDispatch Inheritence class PostsController < ApplicationController def index @posts = Post.order("created_at DESC"). limit(10) end end
    38. 38. ActionPack ActionDispatch Instance Method class PostsController < ApplicationController def index @posts = Post.order("created_at DESC"). limit(10) end end
    39. 39. ActionPack ActionDispatch Instance Variable (field/private variable) class PostsController < ApplicationController def index @posts = Post.order("created_at DESC"). limit(10) end end
    40. 40. ActionPack ActionDispatch Class Class method (static) class PostsController < ApplicationController def index @posts = Post.order("created_at DESC"). limit(10) end end
    41. 41. ActionPack ActionDispatch ActionController
    42. 42. ActionPack ActionDispatch ActionController
    43. 43. ActiveModel ActionDispatch ActionController ActiveRecord
    44. 44. ActiveRecord SQLite/ MySQL/ PostgreSQL/…
    45. 45. ActiveRecord SQLite/ MySQL/ MongoDB/… posts id title body
    46. 46. ActiveRecord SQLite/ MySQL/ MongoDB/… posts id Post title body
    47. 47. ActiveRecord class Post < ActiveRecord::Base end
    48. 48. ActiveRecord post.title post.body post.id post.save post.destroy
    49. 49. ActiveRecord Post.find_by_title "Awesomest post ever!" SELECT * FROM posts WHERE title = 'Awesomest post ever!'
    50. 50. ActiveRecord Post.where("title = 'Awesomest post ever!'") SELECT * FROM posts WHERE title = 'Awesomest post ever!'
    51. 51. ActiveRecord Post.joins(:authors).where("authors.name = 'Joe'") SELECT * FROM posts INNER JOIN authors ON posts.author_id = authors.id WHERE authors.author_name = 'Joe'
    52. 52. ActiveRecord Post.find_by_title "Awesomest post ever!" vs. Post.where("title = 'Awesomest post ever!'")
    53. 53. ActiveRecord class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| t.string :title t.text :body t.timestamps end end def self.down drop_table :posts end end
    54. 54. ActiveRecord Validations validates_presence_of validates_uniqueness_of validates_format_of validates_length_of …
    55. 55. ActiveRecord http://guides.rails.info RTFM
    56. 56. ActiveModel ActionDispatch ActionController class Post < ActiveRecord::Base end
    57. 57. ActiveModel ActionDispatch ActionController ActiveRecord
    58. 58. ActiveModel ActionDispatch ActionController ActiveRecord
    59. 59. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    60. 60. ActionPack ActionDispatch ActionController ActiveRecord <ol> <% @posts.each do |post| %> <li class="post"> <h2><%= link_to post.title, post %></h2> <span><%= post.body %></span> </li> <% end %> </ol>
    61. 61. ActionPack ActionDispatch Iterator (for loop) ActionController ActiveRecord <ol> <% @posts.each do |post| %> <li class="post"> <h2><%= link_to post.title, post %></h2> <span><%= post.body %></span> </li> <% end %> </ol>
    62. 62. ActionPack Block (anonymous function) ActionDispatch ActionController ActiveRecord Block parameter <ol> <% @posts.each do |post| %> do |post| %> <li class="post"> <h2><%= link_to post.title, post %></h2> <span><%= post.body %></span> </li> <% end %> <% end %> </ol>
    63. 63. ActionPack ActionDispatch ActionController ActiveRecord Helper method <ol> <% @posts.each do |post| %> <li class="post"> <h2> </h2> <span><%= post.body %></span> %> <%= link_to post.title, post </li> <% end %> </ol>
    64. 64. ActionPack ActionDispatch ActionController ActiveRecord Helper method <ol> <% @posts.each do |post| %> <li class="post"> <h2> </h2> <span><%= post.body %></span> %> <%= link_to post.title, post </li> <% end %> <a href="...">Post Title</a> </ol>
    65. 65. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    66. 66. ActionPack ActionDispatch ActionController ActionView ActiveRecord <html> ... </html>
    67. 67. http://densitypop.com/posts/22
    68. 68. ActionPack ActionDispatch
    69. 69. ActionPack Blog3::Application.routes.draw do |map| resources :posts end
    70. 70. GET /posts/new Post#new
    71. 71. POST /posts Post#create
    72. 72. GET /posts/edit/22 Post#edit
    73. 73. PUT /post/22 Post#update
    74. 74. GET /posts/22 Post#show
    75. 75. DELETE /posts/22 Post#destroy
    76. 76. ActionPack ActionDispatch
    77. 77. ActionPack ActionDispatch
    78. 78. ActionPack ActionDispatch ActionController
    79. 79. ActionPack ActionDispatch class PostsController < ApplicationController def show @post = Post.find(params[:id]) end end
    80. 80. ActionPack ActionDispatch Request Parameter Hash class PostsController < ApplicationController def show @post = Post.find( ) end params[:id] end
    81. 81. ActionPack ActionDispatch ActionController
    82. 82. ActionPack ActionDispatch ActionController
    83. 83. ActiveModel ActionDispatch ActionController ActiveRecord
    84. 84. ActiveModel ActionDispatch ActionController class Post < ActiveRecord::Base end
    85. 85. ActiveModel ActionDispatch ActionController ActiveRecord
    86. 86. ActiveModel ActionDispatch ActionController ActiveRecord
    87. 87. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    88. 88. ActionPack ActionDispatch ActionController ActiveRecord <h1><%= link_to @post.title, @post %></h1> <span><%= @post.body %></span>
    89. 89. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    90. 90. ActionPack ActionDispatch ActionController ActionView ActiveRecord <html> ... </html>
    91. 91. http://densitypop.com/feed.xml
    92. 92. ActionPack ActionDispatch
    93. 93. ActionPack Blog3::Application.routes.draw do |map| match 'feed.xml', :to => 'posts#index' end
    94. 94. ActionPack ActionDispatch
    95. 95. ActionPack ActionDispatch
    96. 96. ActionPack ActionDispatch ActionController
    97. 97. ActionPack ActionDispatch class PostsController < ApplicationController respond_to :xml def index respond_with(@posts = Post. order("created_at DESC"). limit(10)) end end
    98. 98. ActionPack ActionDispatch ActionController
    99. 99. ActionPack ActionDispatch ActionController
    100. 100. ActiveModel ActionDispatch ActionController ActiveRecord
    101. 101. ActiveModel ActionDispatch ActionController class Post < ActiveRecord::Base end
    102. 102. ActiveModel ActionDispatch ActionController ActiveRecord
    103. 103. ActiveModel ActionDispatch ActionController ActiveRecord
    104. 104. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    105. 105. ActionPack ActionDispatch ActionController ActiveRecord atom_feed do |feed| feed.title("Joe's Awesome Blog!") feed.updated(@posts.first.created_at) @posts.each do |post| feed.entry(post) do |entry| entry.title(post.title) entry.content(post.body, :type => 'html') entry.author { |author| author.name("Joe") } end end end
    106. 106. http://densitypop.com/posts.json
    107. 107. ActionPack ActionDispatch
    108. 108. ActionPack Blog3::Application.routes.draw do |map| resources :posts end
    109. 109. ActionPack ActionDispatch
    110. 110. ActionPack ActionDispatch
    111. 111. ActionPack ActionDispatch ActionController
    112. 112. ActionPack ActionDispatch class PostsController < ApplicationController respond_to :xml, :json def index respond_with(@posts = Post. order("created_at DESC"). limit(10)) end end
    113. 113. ActionPack ActionDispatch ActionController
    114. 114. ActionPack ActionDispatch ActionController
    115. 115. ActiveModel ActionDispatch ActionController ActiveRecord
    116. 116. ActiveModel ActionDispatch ActionController class Post < ActiveRecord::Base end
    117. 117. ActiveModel ActionDispatch ActionController ActiveRecord
    118. 118. ActiveModel ActionDispatch ActionController ActiveRecord
    119. 119. ActionPack ActionDispatch ActionController ActiveRecord ActionView
    120. 120. ActionPack ActionDispatch ActionController ActiveRecord [This slide intentionally left blank]
    121. 121. There you go. Isn’t that easy?
    122. 122. Digging Deeper
    123. 123. Nothing is Sacred Anything can be overridden
    124. 124. Not all magic Some illusions too
    125. 125. Enterprise Ready http://www.workingwithrails.com/high-profile-organisations
    126. 126. http://bit.ly/websigrailslinks
    127. 127. Resources http://bit.ly/websigrailslinks
    128. 128. Cleveland Ruby Brigade http://www.meetup.com/ClevelandRuby http://bit.ly/websigrailslinks
    129. 129. Agile Web Dev. with Rails http://pragprog.com/titles/rails4/ http://bit.ly/websigrailslinks
    130. 130. Rails 3 in Action http://www.manning.com/katz/ http://bit.ly/websigrailslinks
    131. 131. http://bit.ly/websigrailslinks
    132. 132. The End
    133. 133. http://speakerrate.com/joefiorini Please rate this talk (only if it’s good)!
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×