3
更新或創建記錄後,我用URL助手來重定向到頁面上的部分,其中記錄發生在位於:如何在Ruby on Rails中從url中捕獲錨值?
if record.save
....
redirect_to records_url, :anchor => "record_" + record_id.to_s
end
結果URL將會像
http://localhost:3000/records#record_343242
我想突出顯示使用jQuery或原型的記錄,並且錨點是我正在尋找的確切ID。我可以捕捉它嗎?