Web Development  >>  Ruby On Rails

Railscasts Week 8

Language : English Quality : High Has Audio : true Source : showmedo Media : Flash
Let Ryan Bates take you through a growing series of great Rails tips.

Tags: Ruby On Rails, Ruby, Showmedo, Screencast, Web Development,     [SUGGEST  A  TAG]

Resources referenced in this screencast
  • Ruby on Rails
  • Eager Loading

    One way to improve performance is to cut down on the number of SQL queries. You can do this through eager loading. Learn all about it in this episode!

    Counter Cache Column

    If you need to display the record count for a has_many association, you can improve performance by caching that number in a column.

    The Stack Trace

    The stack trace can be a very useful tool when it comes to debugging. Learn the ins and outs of how the stack trace works in this episode. Note: I am using an older version of the Rails bundle here so it might be a little different than yours. The command in the newer version is called Install Plugin and requires you to type textmate_footnotes in the search.


    Articles Realted to this Topic

    [SUGGEST  A  ARTICLE]
    Content-only caching for Rails
    So you’ve got a Rails app which is mostly static content, but it’s got some dynamic, user-specific stuff mixed in with the layout. You’d love to cache the static data, since it doesn’t change often, but that would leave you updating the dynamic content via AJAX or something, and as cool as AJAX is, it’s for crap when the Javascript is turned off
    Debugging on Rails: Reading Stack Traces
    A stack trace is that thing Rails spits out when there is a problem in the code.
    Eager loading with cascaded associations
    I created a patch that removes limitations for depth of joining tables when we use eager loading. Now we can cascade associations as much as we want!
    Eager loading objects in a Rails has_many :through association
    As with standard joins, you can use the find method’s :include option to include associated objects within the query. But I wasn’t having much luck pulling in both the runs and the venues: the runs would be detected, but iterating through the productions would trigger a fresh SQL query to find the relevant venue information.