我在 edit 方法判断如果没有新的 model,就 new 一个,这时候原有的散列需要传进去,可是我觉得 code: params[:code], date: params[:date] 写法太难看,试了几种别的不行,应该可以解构这个散列,不知道怎么写
 def edit
  ...
  if st.count > 0
    @strategy = st.first
  else
    redirect_to controller: 'strategies', action: 'new', code: params[:code], date: params[:date]
  end
end
def new
    @strategy = Strategy.new(code: params[:code], date: params[:date])
end
def strategy_params
    params.require(:strategy).permit(:code, :date)
end