Sign in through GitHub
watch on iTunes
follow on Twitter
follow on Facebook
subscribe to RSS feed
Browse Episodes
RailsCasts Pro
About
Feedback
#6
Shortcut Blocks with Symbol to_proc
Mar 16, 2007 | 3 minutes |
Active Support
It may have a goofy syntax, but the Symbol#to_proc feature Rails adds allows you to do simple blocks very quickly and easily.
Click to Play Video ▶
Tweet
Download:
mp4
Full Size H.264 Video (5.34 MB)
m4v
Smaller H.264 Video (3.95 MB)
webm
Full Size VP8 Video (11.1 MB)
ogv
Full Size Theora Video (9.18 MB)
Show Notes
ASCIIcast
7 Comments
Similar Episodes
Next Episode >
< Previous Episode
models/task.rb
def self.all_names find(:all).collect(&:name) end
def
self
.
all_names
find(
:all
).collect(&
:name
)
end