我有这个控制器方法:
def slide_change
j=params[:val]
g=TargetPortfolio.new
@h,@lock=g.finding_the_concerned_id(j)
#@h , @lock both are array.
last=TargetPortfolio.last # TargetPortfolio is model class
last.update_attributes(folders: @h)
redirect_to :action => "target_port" #with this i need to pass @lock as argument
end
控制器的另一种方法target_port:
def target_port
@h=TargetPortfolio.last.folders
# @lock from the slide_change
end
可用路线
slide_change GET /slide_change(.:format) Portfolio#slide_change
/:controller(/:action(/:id))(.:format) :controller#:action
我有使用 @h 和 @lock 的 target_port.erb 。任何猜测我怎么能做到这一点。