Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
// Place your application-specific JavaScript functions and classes here | ||
// This file is automatically included by javascript_include_tag :defaults | ||
|
||
function authToken() { | ||
return 'authenticity_token=' + encodeURIComponent(AUTH_TOKEN); | ||
} | ||
|
||
function remote_get_link_to(ajaxPath, linkId) { | ||
Event.observe(linkId, 'click', function() { | ||
var link = new Element(linkId); | ||
new Ajax.Request(ajaxPath, | ||
{ asynchronous: true, evalScripts: true, method: 'get', | ||
parameters: authToken() | ||
}); | ||
return false; | ||
}); | ||
} |