0
我需要在下面的代碼中進行更改以使其鏈接到呈現爲json的視圖?如何創建鏈接到Rails中的對象的json視圖?
<%= link_to 'JSON Link', @mymodel %>
所以我想生成以下網址的
http://localhost:3000/mymodels/1.json
代替
http://localhost:3000/mymodels/1
(這些網址都工作正常。)
那麼簡單,但我認爲這沒有任何地方。謝謝! –