Created
April 4, 2017 15:13
-
-
Save alistairtweed/fb1c455309b4ae8a296a63699a21ea88 to your computer and use it in GitHub Desktop.
Remote Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
def remote_link | |
respond_to do |format| | |
format.js | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= link_to "Remote Link", remote_link_url, remote: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Clicked!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get "remote-link", to: "application#remote_link", as: :remote_link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment