I have already done some learning on Ruby before this book, but am getting very confused about the use of :’s (colons). For example, in Ch. 4, couple of paragraphs before regular expressions we have the line:
redirect_to action: 'show', id: product.id
The text says: “You can pass hashes as parameters on method calls. Ruby allows you to omit the braces… The following code fragment shows a two-element hash being passed to the redirect_to() method…”
So, redirect_to( param1, param2)? in that case I am really confused. Param 1 would be
action: 'show' and… um… I’m lost, I just can’t get the syntax of this, and I am happily programming away in Ruby 1.9.
Could someone explain what is going on please and what part of the syntax is Rails and what is Ruby? I have read over it for the last half hour and I am just not seeing it.