Search code examples
ruby-on-rails-3http-redirectcontrollerforwarding

Forwarding in Rails


In Java Servlets/JSP you can redirect (round trip to server) request or forward request (in scope of the same request). It seems that Rails docs only have examples of redirecting. How can I implement forwarding in Rails 3? Thanks advance.


Solution

  • See http://www.ruby-forum.com/topic/3810690

    Workaround seems to be creating a wrapper for the controller logic and calling it from both actions, while rendering a shared template. Not exactly ideal, but will at least DRY you up a bit.