Created
March 24, 2009 01:47
-
-
Save laktek/83885 to your computer and use it in GitHub Desktop.
This file contains hidden or 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("Remote outauthor", { :url => { :action => "whatnot" }}, { :class => "fine" }) | |
#Currently renders: | |
<a class="fine" href="#" onclick="new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true}); return false;">Remote outauthor</a> | |
#suggested view render: | |
<a class="fine" data-rails-remote="true" href="http://www.example.com/whatnot">Remote outauthor</a> | |
#Method implemented by jquery.rails.js helper | |
$(a["data-rails-remote=true"]).($.ajax({ | |
url: $(this).attr("href"), | |
async: false | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment