title: Ruby on Rails - Scope of Instance Variables with Partial Views
body: <p>I do not understand how to use instance variable properly with partial
  views, I am hoping someone here can enlighten me. For example:</p>
  
  <pre><code>class MainController &lt; ApplicationController
  
    def index
      @item_list = Item.find_all_item
    end
  
    def detail_display
      @current_selected = @item= Item.find(params[:id])
        redirect_to :action =&gt; :index
    end
  end
  </code></pre>
  
  <p><code>detail_display</code> is invoked when the user clicks on an item in the list.
  The variable <code>@current_selected</code> is not available to the partial view
  invoked when the index is redirected to. How can I remedy this?</p>
  
  <p>Thank you</p>