Created
January 8, 2010 08:37
-
-
Save petrblaho/271924 to your computer and use it in GitHub Desktop.
jQuery in Rails application
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
<%= javascript_include_tag 'jquery', 'jquery-ui' %> | |
<% if protect_against_forgery? %> | |
<script type='text/javascript'> | |
//<![CDATA[ | |
window._auth_token_name = "#{request_forgery_protection_token}"; | |
window._auth_token = "#{form_authenticity_token}"; | |
//]]> | |
</script> | |
<% end %> | |
<%= javascript_include_tag 'application' %> |
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
jQuery.ajaxSetup({ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment