我一直在3.2.3建立一個應用程序,它工作正常,只要我升級到3.2.6以解決安全漏洞,我的一個路由停止工作。Rails 3.2.6路由不再工作
這是一個簡單的視圖,當我點擊編輯塊對象時,它會將我帶到編輯屏幕。然而,當我做出改變,並點擊提交我收到此錯誤:
Routing Error
No route matches {:action=>"edit", :controller=>"units", :id=>nil}
在我的控制器有一個編輯和更新操作:
def edit
@units = Unit.find(params[:id])
end
def update
@units = Unit.find(params[:id])
respond_to do |format|
if @units.update_attributes(params[:unit])
format.html { redirect_to @units, notice: 'Unit was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @units.errors, status: :unprocessable_entity }
end
end
end
在更新動作,如果我改變redirect_to的@units到redirect_to units_path錯誤消失。在3.2.6中有什麼改變,不會讓你像我一樣重定向?我有另一個具有完全相同的編輯和更新操作的控制器,並且它可以正常工作。
我有兩個筆記本電腦一個3.2.3和另一個3.2.6。 3.2.3正常工作,但只要我升級它,我得到了同樣的錯誤。
任何幫助表示讚賞。
你可以請你的觀點? –