calebhearth / formulaic

Simplify form filling with Capybara
MIT License
552 stars 29 forks source link

Fix syntax error in usage #14

Closed mathieul closed 10 years ago

gregmolnar commented 10 years ago

It is not a syntax error just a matter of taste.

calebhearth commented 10 years ago

Right. I almost always write my hashes like you've changed this to, but in this case I left the braces because it led into passing variables or method calls right into the fill_form call, which is probably the more common use case.

mathieul commented 10 years ago

Well in MRI it is:

irb(main):001:0> { name: 'Caleb', email: 'caleb@thoughtbot.com', 'Terms of Service': true }
SyntaxError: (irb):1: syntax error, unexpected ':', expecting =>
...htbot.com', 'Terms of Service': true }
...                               ^
    from /Users/mathieu/.rbenv/versions/2.1.1/bin/irb:11:in `<main>'
calebhearth commented 10 years ago

Ah, you're right. I was distracted by the brace removal. Can you add those back in and keep the change from '': to '' =>?

gregmolnar commented 10 years ago

@mathieul well spotted! Like @calebthompson I also thought you just removed the braces :D

calebhearth commented 10 years ago

Too much javascript lately :D

calebhearth commented 10 years ago

Ping @mathieul

mathieul commented 10 years ago

Hey. I just pointed out the error, I don't mind if you close this pull request and fix it the way which suits you. Cheers.