Why are parenthesis sometimes required in Ruby?
问题 I recently ran into an oddity while looking at some Ruby code from the Rails docs. Ruby lets you pass arguments like these examples: redirect_to post_url(@post), alert: "Watch it, mister!" redirect_to({ action: 'atom' }, alert: "Something serious happened") But that second case looked odd to me. It seems like you should be able to pass it like so: redirect_to { action: 'atom' }, alert: "Something serious happened" And it would have the same meaning with or without parenthesis. But instead you