Created
September 23, 2008 18:08
-
-
Save jackdempsey/12358 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
diff --git a/lib/merb-core/controller/mixins/controller.rb b/lib/merb-core/controller/mixi | |
index 8c8078c..0b3c596 100644 | |
--- a/lib/merb-core/controller/mixins/controller.rb | |
+++ b/lib/merb-core/controller/mixins/controller.rb | |
@@ -127,7 +127,9 @@ module Merb | |
def redirect(url, opts = {}) | |
default_redirect_options = { :message => nil, :permanent => false } | |
opts = default_redirect_options.merge(opts) | |
- if opts[:message] | |
+ if opts[:message] || opts[:notice] || opts[:error] | |
+ opts[:message][:notice] = opts[:notice] if opts[:notice] | |
+ opts[:message][:error] = opts[:error] if opts[:error] | |
notice = Merb::Request.escape([Marshal.dump(opts[:message])].pack("m")) | |
url = url =~ /\?/ ? "#{url}&_message=#{notice}" : "#{url}?_message=#{notice}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment