2009/12/11 pankaj <pankajbhage...@gmail.com>:
> Hi,
>   Lets assume we have an url, /controller1/action1.
>   In the before filter, under certain conditions, I want to route it
> to /controller2/action2. without changing the url at the client side
> ie I donot want to use redirect. Please help.
>

class FooController < ApplicationController
  before_filter :maybe_redirect

  protected

   def maybe_redirect
      redirect_to your_url
      false
   end
end

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to