title: Redirect to action of controller using ajax call
body: <p>I am using jquery ajax call and in controller action i want to redirect some action but when</p>
  
  <p>i use redirect_to "/some_action". Then it did not redirect to my desired action please give </p>
  
  <p>any  useful suggestions.</p>
  
  <pre><code>&lt;%= link_to "javascript:;" ,:onclick =&gt; "admin_fun"%&gt;
  </code></pre>
  
  <p>my jquery ajax call is</p>
  
  <pre><code>function admin_fun() {
    if (confirm("Are you sure you want to add?")) {
      var container = $("#trunk_detail");
  
      $.ajax({
        url:'/accounting/add_rule',
        type:'get',
        dataType:'html',
        processData:false,
        success:function (data) {
          container.html(data);
        }
      });
    }
  }
  </code></pre>
  
  <p>my controller code is </p>
  
  <pre><code>def add_rule
    # do somthing
  
    redirect_to "/accounting/index_report"   
  
    render :text =&gt; "ok"
  end
  </code></pre>