I just started learning ruby on rails. I’m using ‘Agile Web Development with Rails, 4th Edition, Rails 3.1’ book. I have rails 3.1.3 installed.
In the examples in the book show the code like this:
<%= f.text_area :description, rows: 6 %>
but this code doesn’t work. I have to change to code to:
<%= f.text_area :description, :rows=> 6 %>
This works but I have no idea why. Could someone explain why it is in the book like this?
Thanks
The book uses ruby 1.9’s new syntax for hash literals. Apparently you’re still using ruby 1.8, so that syntax does not work on your version.
Note that this is about ruby syntax and not specific to rails.