Created
August 27, 2010 00:51
-
-
Save rafb43/552547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| # odd difference between Ruby's AND comparison operators: '&&' and 'and' | |
| ## | |
| # with '&&' it will throw an error expecting 'end' after params.include? | |
| if request.post? && request.params.include? 'post_param' then | |
| end | |
| # with 'and' it will work fine and you'll call the day for a beer | |
| if request.post? and request.params.include? 'post_param' then | |
| end | |
Author
That would probably work. But the odd thing is the difference between both operators, they should be the same AFAIK
even ruby can be odd sometimes :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's why I do use of parenthesis everywhere :)
did you try this?