def redirect(url, opts = {})
      default_redirect_options = { :message => nil, :permanent => false }
      opts = default_redirect_options.merge(opts)

      url = handle_redirect_messages(url,opts)
      self.status = opts[:permanent] ? 301 : 302
      Merb.logger.info("Redirecting to: #{url} (#{self.status})")
      headers['Location'] = url
      "<html><body>You are being <a href=\"#{url}\">redirected</a>.</body></html>"
    end
def redirect(url, opts = {})
      default_redirect_options = { :message => nil, :permanent => false }
      opts = default_redirect_options.merge(opts)

      url = handle_redirect_messages(url,opts)
      self.status = opts[:permanent] ? 301 : 302
      Merb.logger.info("Redirecting to: #{url} (#{self.status})")
      headers['Location'] = url
      "<html><body>You are being <a href=\"#{url}\">redirected</a>.</body></html>"
    end
==== Parameters
 url<String>::
   URL to redirect to. It can be either a relative or fully-qualified URL.
 opts<Hash>:: An options hash (see below)

 ==== Options (opts)
 :message<Hash>::
   Messages to pass in url query string as value for "_message"
 :permanent<Boolean>::
   When true, return status 301 Moved Permanently
 :notice<String>::
   Shorthand for common usage :message => {:notice => "..."}
 :error<String>::
   Shorthand for common usage :message => {:error => "..."}
 :success<String>::
   Shorthand for common usage :message => {:success => "..."}

 ==== Returns
 String:: Explanation of redirect.

 ==== Examples
   redirect("/posts/34")
   redirect("/posts/34", :message => { :notice => 'Post updated successfully!' })
   redirect("http://www.merbivore.com/")
   redirect("http://www.merbivore.com/", :permanent => true)
   redirect("/posts/34", :notice => 'Post updated successfully!')

 :api: public