I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top, and I tried this in the rails console
User.new(name: "Michael Hartl", email: "[email protected]")
SyntaxError: compile error
but when I tried this it worked:
User.new(:name=> "Michael Hartl", :email=>"[email protected]")
=> #<User id: nil, name: "Michael Hartl", email: "[email protected]", created_at: nil, updated_at: nil>
I am using rails 3.2.1, which I guess this is the problem, but why change the syntax to something more complicated like, :<variable>=> instead of <variable>: ??