[英]Where do I find the url that the built in rails server provides to store data?
I want to use the $.ajax()
call and I'm not sure where to point the url:
我想使用
$.ajax()
调用,但是我不确定在哪里指向该url:
I use the embedly API to change a link to an embedded video, thumbnail, and title. 我使用嵌入式API来更改指向嵌入式视频,缩略图和标题的链接。 The link is located in two partials.
链接位于两个部分。 One of the partials is rendered by the
show
view, and the other is rendered in the index
view. 部分视图由
show
视图呈现,而另一个视图则在index
视图中呈现。 The views are in the videos
directly of views
. 观看
videos
直接出现在views
的videos
中。 I want to POST the data that is generated dynamically from this link to the server. 我要发布从此链接到服务器动态生成的数据。 What url should I be pointing to?
我应该指向哪个网址?
What type of resource are you trying to save? 您要保存什么类型的资源? Without knowing more details it is hard to say.
不知道更多细节,很难说。 But, you have to setup the correct routes, controller, and models to handle your ajax requests.
但是,您必须设置正确的路由,控制器和模型来处理您的ajax请求。
Read some of the rails guides, specifically the Getting Started guide to get going. 阅读一些rails指南,特别是Getting Started指南。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.