#42 with_options

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.

Hey, great job on the screencast. I love watching your tips and tricks. One thing I have a question about though. Not to do with Rails, but rather Textmate. I noticed about 3/4 into the cast, that you selected "map." on two different lines, and then were able to edit both lines simultaneously... My jaw dropped on that one. Could you explain how you did that?

@Ben, the trick is to hold down the "option" key while you make a selection in textmate. This will switch it to column mode and allow you to edit multiple lines at once. After you make a selection you can hit "option" again to toggle back and forth. It's pretty useful. :)

Ryan, this site is amazing and I point developers to it whether they are newbies or experienced.

While watching this episode, I couldn't figure out which object actually gets passed to the block. It is worth noting that the object calling with_options is itself passed as the parameter to the block.

Hrmm that was weird, my comment got eaten. Anyway I wanted to say that its nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks.