How is a symbol (ex. :label) handled as part of a parameter hash

ruby

Solution

Yes, I believe so, otherwise the `:label` symbol will always be passed as a `method` name to `label` helper.

Problem

I was looking at example code from the O'Reilly book on Ruby on Rails and ran across this: ``` def label_for(method, options={}) extra = "" if options[:required] extra = " <span class='required_mark'>*</span>" end label(:label || method) + extra + "<br />" end ``` I understand that `options` is a hash, but how is it able to call `label` with just `:label` -- shouldn't it need to say `options[:label]` ? Thanks!

Original source