From 1042de2370354ddb283eaa2a6c3a6166f7aaf0be Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 24 Nov 2004 19:46:30 +0000 Subject: Added Request#ssl? which is shorthand for @request.protocol == "https://" git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_controller/request.rb | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 2da77a2144..e16694068e 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *CVS* +* Added Request#ssl? which is shorthand for @request.protocol == "https://" + * Added the choice to call form_tag with no arguments (resulting in a form posting to current action) [bitsweat] * Upgraded to Builder 1.2.1 diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 1085066ea0..f54a00dd86 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -54,6 +54,10 @@ module ActionController port == 443 ? "https://" : "http://" end + def ssl? + protocol == "https://" + end + def path request_uri ? request_uri.split("?").first : "" end -- cgit v1.2.3