Skip to content

Instantly share code, notes, and snippets.

@rafb43
Created August 27, 2010 00:51
Show Gist options
  • Select an option

  • Save rafb43/552547 to your computer and use it in GitHub Desktop.

Select an option

Save rafb43/552547 to your computer and use it in GitHub Desktop.
##
# 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
@rafaelss
Copy link

even ruby can be odd sometimes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment