看板 Ruby 關於我們 聯絡資訊
環境: e.g. Ruby 1.9.2 Rails 3.1.0 狀況: 所有的連結都正常,唯獨destroy這個連結會變成show... route.rb的部份 resources :customers 連結的部份: <%= link_to 'Destroy', customer, :confirm => 'Are you sure?', :method => :delete %> controller的部份 def destroy @customer = Customer.find(params[:id]) @customer.destroy respond_to do |wants| wants.html { redirect_to(customers_url) } wants.xml { head :ok } end end 在網頁按右鍵看原始碼... <a href="/customers/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a> 檢查看起來都沒錯呀,請問為什麼點Destroy會一直連到show呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.160.30.55
hellolucky:確認一下js是不是都有load到...可以看網頁原始碼 09/25 19:12