使用jquery和ajax在客户端调用Rails服务器方法 [英] invoking rails server method using client side using jquery and ajax

查看:174
本文介绍了使用jquery和ajax在客户端调用Rails服务器方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在红宝石上工作,这是我的新手.

我需要在应用程序中已经存在的链接的onclick事件中调用Rails控制器方法.

我了解到无法通过运行客户端的javascript调用Rails服务器方法.

如果有人帮助我用ajax编写jquery来执行此操作,我将不胜感激.

Hi,
I am working in ruby on rails and i am new to that.

I need to invoke a rails controller method as onclick event of already existing links in my application.

I learnt that it is not possible to invoke rails server method throug javascript which runs client side.

I would appreciate if anyone help me to write jquery with ajax for doing this thing.

推荐答案

您好,Fathima,

为此,您有许多方法可以从客户端调用服务器端方法.

其中一些是

PageMethods
Ajaxpro(第三方javascript库)
jQuery
Hi Fathima,

For this you have many approches are their to call server side method from client side.

Some of them are

PageMethods
Ajaxpro (A third party javascript library)
Jquery


.ajax()
其他许多方法...

您可以选择任何一个

http://www.dotnetcurry.com/ShowArticle.aspx?ID=109 [ ^ ]

http://stackoverflow.com/questions/886903/calling-asp-网络服务器端方法通过jquery

[^ ] http://www.ajaxpro.info/quickguide.aspx [
.ajax()
Many other approches...

you can choose any of them

http://www.dotnetcurry.com/ShowArticle.aspx?ID=109[^]

http://stackoverflow.com/questions/886903/calling-asp-net-server-side-method-via-jquery

[^]http://www.ajaxpro.info/quickguide.aspx[^]

Thanks
SP


这篇关于使用jquery和ajax在客户端调用Rails服务器方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆