there is one note about the element order in hashes:
Ruby 1.9 actually guarantees that hashes keep their elements in the same order entered, but it would be unwise ever to count on a particular ordering.?
?
==================================================
?
let's see this method:
?
stylesheet_link_tag 'blueprint/screen', :media => 'screen'
?
you will find the last param is a hash, but why there is no {} around this hash?
?
the reason is this:
?
when the hash is the last argument in a function call, the {} is optional, the following two lines are equivalent:
?
?
stylesheet_link_tag 'blueprint/screen', { :media => 'screen' } stylesheet_link_tag 'blueprint/screen', :media => 'screen'
?
note this only apply to a function call, not a function definition.
?
by the way, the html generated by the above code is:
?