Why are you wrapping params['id'] in double quotes?  If params['id'] is
already equal to your key in @codes, you can just use:

@codes[params['id']]

-Scott