skip to main | skip to sidebar

Stumbling into the World of Ruby on Rails

Programming, Business, Fun, and Ruby on Rails - One day at a time!

Thursday, May 22, 2008

to_proc or not to proc

Instead of writing this


Profile.find(:all).collect{ |x| x.email }


I could write this using Rails' Symbol#to_proc


Profile.find(:all).collect(&:email)


Nice.
Posted by Fadhli Rahim at 12:22 AM
Labels: programming, Ruby, Ruby on Rails

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Contributors

  • Acap
  • Fadhli Rahim
  • john abruzzi

Labels

  • Ruby on Rails
  • programming
  • Rails
  • Ruby
  • barcamp
  • unconference
  • web2.0
  • Cheatsheet
  • agile
  • barcamp malaysia
  • tutorials
  • Git
  • Scrum Wall
  • Sprint Retrospect
  • Sprint Review
  • Study Guide
  • XP
  • nested layouts
  • scribd
  • wall

Blog Archive

  • ▼  2008 (27)
    • ►  July (6)
    • ►  June (5)
    • ▼  May (16)
      • Much more than Android
      • Rails training, anyone?
      • Sprint Review & Retrospect Meeting
      • Git Cheat Sheet
      • to_proc or not to proc
      • Use filter_parameter_logging for your password
      • Incompetent git!! Or is it?
      • Prototype and Scriptaculous? OMG!!!
      • The Wall is up and moving!
      • Ruby Cheatsheet Part Two!
      • Ruby Syntax Cheatsheet
      • 7 do's and 3 don'ts for creating web products
      • 1st half of wall is up!!
      • Project Wall
      • Agile Software Development Process
      • Our First Blog! (and Entry!)

Our Favorite Sites

  • Railscasts - free RoR screencasts