title: Opening a new browser tab from rails action in the controller
body: <p>so i have a Exam controller. Now the the file for it has a jqgrid (index.html.erb )on it. One clicks on the grid row and i have set upped the javascript for handling the event.
  it looks like</p>
  
  <pre><code>&lt;script type= "text/javascript"&gt;
  function handleSelection(id) {
      &lt;%=  
      remote_function :url =&gt; render_exam_exams_path,:with =&gt; "'id='+id" 
      %&gt;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>now the the method i was just testing as follows</p>
  
  <pre><code>def render_exam
      @exams = Exam.find(params[:id])
      #either
      #redirect_to home_index_path
      #or open this in new browser tab        
      #render :action =&gt; "render_exam"
  end
  </code></pre>
  
  <p>and I have a view called render_exam as well. Now i have checked the server logs and all, everything works fine even the render_exam is generated as i could see that in chrome developer plugin. Now the problem is i want either </p>
  
  <ol>
  <li>the controller action render_exam to open up a new tab and render render_exam view as it seems to be happening remotely (generating render_exam view and all)without changing the jqgrid page. But I couldn't find a way to open up a new browser tab to render the render_exam action view from the render_exam action itself rather than happening behind the scene.
  or</li>
  <li>have the jqGrid (or index view) page redirected to the render_exam view. Now the problem here was the redirect_to action doesn't work in the view as it is supposed to be controller method. So i can't say.</li>
  </ol>
  
  <hr>
  
  <pre><code>&lt;script type= "text/javascript"&gt;
  function handleSelection(id) {
      &lt;%= redirect_to :action =&gt; render_exam_exams_path, :with =&gt; "'id='+id"  %&gt;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>otherwise the problem would have been solved.
  Any help is appreciated 
  thanks</p>