Is there a :disable_with equivalent for link_to_remote?
问题 I have a link_to_remote and I want to make sure people can only click it once while waiting for it to return. Is there a good way to disable it after someone clicks it? (Changing the text of the link is nice too, but I want to disable it also to be sure). This is Ruby on Rails btw. 回答1: You can't disable a link, but you can change the href for example. So you can use :before or :loading hooks to "disable" the link using javascript . 回答2: I ended up replacing the link in the :before block like