Like in topic - is there some option to remove action for
link_to
after click on it?
No, you need to do this through Javascript. When the link is clicked you can set a disabled attribute. On subsequent clicks, you can then check for the attribute and if it is set, you can then use e.preventDefault();
to prevent the link from being following.
If you're using something like Twitter Bootstrap, there are some more elegant options, via button loading states.
根据您要尝试执行的操作,您可能可以设置link_to_if
和link_to_unless
来实现所需的目标。
Take a look of this, a good explation of this guy:
the right way to do it:
a {
pointer-events: none;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.