moomerman-rambo 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rambo/controller.rb +4 -0
- data/lib/rambo/controller/redirect.rb +2 -2
- metadata +1 -1
data/lib/rambo/controller.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Redirect
|
2
2
|
def redirect(destination, options={})
|
3
3
|
destination = destination.to_s if destination.is_a? Symbol
|
4
|
-
unless destination[0,1] == "/"
|
4
|
+
unless destination[0,1] == "/" or destination =~ /^http:\/\// or destination =~ /^file:\/\//
|
5
5
|
destination = "/#{self.controller}/#{destination}"
|
6
6
|
end
|
7
|
-
|
7
|
+
puts "redirecting to #{destination}"
|
8
8
|
|
9
9
|
@rendered = true
|
10
10
|
response.status = 302
|