title: how to pass a variable with redirect_to?
body: <p>In my controller destroy function, I would like to redirect to index after the item deleted, and I would like to pass a variable called 'checked' when redirect:</p>
  
  <pre><code>def destroy
      @Car = Car.find(params[:id])
      checked = params[:checked]
  
      if @car.delete != nil
  
      end
  
      redirect_to cars_path #I would like to pass "checked" with cars_path URL (call index)
  end
  </code></pre>
  
  <p>how to pass this 'checked' variable with <strong>cars_path</strong> so that in my index function I can get it?? (<strong>cars_path</strong> calls <em>index</em> function)</p>
  
  <pre><code>def index
   checked = params[checked]
  end
  </code></pre>