From 26d22f38152a9ee14516b5af5e2fae228a385472 Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Sun, 12 Sep 2010 01:35:50 +0200 Subject: [PATCH] Swap conditional order for better readability "if X else Y" constructs are generally easier to read than "unless Y else X" constructs. --- .../lib/action_view/helpers/form_tag_helper.rb | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 43ffadc..b6e76d9 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -572,10 +572,10 @@ module ActionView end def token_tag - unless protect_against_forgery? - '' - else + if protect_against_forgery? tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) + else + '' end end -- 1.7.2.3