0
如何render :new
並將位置設置爲question/:id/new/answer
?如何渲染一個動作並在Rails 3中設置URL?
render :location => new_question_path
設置位置question/:id/answer
render :location => "/question/#{params[:id]}/new/answer"
也不能工作。
相關路線:get '/question/:id/new/answer' => 'answers#new', as: :new_answer
的路徑,你可以發佈您的routes.rb? –
不應該是'render:location =>「/ question /#{params [:id]}/answer/new」'而不是? –