开发者

How can I add Ajax link into Rails?

开发者 https://www.devze.com 2023-04-02 04:58 出处:网络
In my helper code I add Ajax link as follows. <%= 开发者_如何学JAVAlink_to \'name\', events_path(@event), :remote => true %>

In my helper code I add Ajax link as follows.

<%= 开发者_如何学JAVAlink_to 'name', events_path(@event), :remote => true %>

When I run my application it will show "We're sorry, but something went wrong." I couldn't understand why is this happened. Can anybody help me to correct this?


What is it supposed to do? I suppose you must add some javascript to be executed once the request is finished. But there seems to be a problem with the name of the link, should it not be named event_path(@event) (not plural events), or just @event should do I guess.

0

精彩评论

暂无评论...
验证码 换一张
取 消