Quantcast
Channel: Pragmatic Forums | Posts by Tan YL
Viewing all articles
Browse latest Browse all 19

noob question: state_lookup = us_states.index_by {|state| state.short_name} posted by Tan YL @ Sun, 03 Aug 2008 04:43:11 +0000

$
0
0

state_lookup = us_states.index_by {|state| state.short_name}

what exactly is |state| supposed to repressent? why do we need to to call the object again? doesn’t rails understand that state.short_name will come from state? I thought rails was trying to eliminate redundancy.


Viewing all articles
Browse latest Browse all 19

Trending Articles