I have a link which, when clicked, will make an AJAX call. This AJAX call will result in a modal showing up.
= link_to edit_evaluation_path(evaluation), remote: true
However, when trying to open a new tab from the link (by clicking it with the middle mouse button, for example) I've been getting a ActionController::UnknownFormat: ActionController::UnknownFormat
error, because the action is not expecting to respond with a html format. Here's the respond_to
code from the corresponding action:
respond_to do |format|
format.js
end
How can I prevent the user from opening the link in another tab or window? Am I obliged to change the link_to
to a button_to
? Thanks!