Web Development  >>  Ruby On Rails

rails with_options

Language : English Quality : High Has Audio : true Source : Other Media : QuickTime
Several methods in rails take a hash of options as the last argument. If you are passing the same options to several methods, you can remove this duplication by using with_options. Learn all about it in this episode.

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

Resources referenced in this screencast
  • Ruby on Rails

  •  OR 
    Created : 2007-06-08   Duration : 03:55 (9 MB)


    (Requires : MPEG-4 Video Player)
    Download file is iPod compatable

    Articles Realted to this Topic

    [SUGGEST  A  ARTICLE]
    rails Object with_options
    In Named, explicit routes I mentioned Object#with_options in passing, only to discover later that this super-useful method is not documented in Rails’ API docs! I’ve since corrected the situation in trunk, but the method is useful enough (particularly in conjunction with routing) that I figured it was worth blogging about.
    Using with_scope to refactor Rails finder methods.
    I have come across a great way of refactoring finder methods, yet still maintaining the flexibilty of the built in ActiveRecord finder methods. First I'll show an inflexible way of refactoring a simple finder. I was calling the following method from several places in my controller