I do not understand how to use the instance variable with partial views correctly; I hope that someone here can enlighten me. For example:
class MainController < ApplicationController
def index
@item_list = Item.find_all_item
end
def detail_display
@current_selected = @item= Item.find(params[:id])
redirect_to :action => :index
end
end
detail_displayCalled when a user clicks on an item in a list. A variable that is @current_selectednot viewable is called when the index is redirected. How can i fix this?
thanks
source
share