0
我需要在下面的代码中进行更改以使其链接到呈现为json的视图?如何创建链接到Rails中的对象的json视图?
<%= link_to 'JSON Link', @mymodel %>
所以我想生成以下网址的
http://localhost:3000/mymodels/1.json
代替
http://localhost:3000/mymodels/1
(这些网址都工作正常。)
那么简单,但我认为这没有任何地方。谢谢! –