Like in topic - is there some option to remove action for
link_to
after click on it?
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.
Depending on what you're trying to do, you can probably finagle link_to_if
and link_to_unless
to get achieve what you want.
Take a look of this, a good explation of this guy:
the right way to do it:
a {
pointer-events: none;
}