Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support turbolinks data attributes #36

Closed
wants to merge 1 commit into from
Closed

Support turbolinks data attributes #36

wants to merge 1 commit into from

Conversation

naan
Copy link

@naan naan commented Jul 4, 2013

turbolinks requires to add data-turbolinks-track to detect assets have been changed. (FYI: https://github.com/rails/turbolinks#asset-change-detection ) I made a change that adds data attributes into script and stylesheet link tag.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling cf89e5a on naan:turbolinks into 0b8f155 on ixti:master.

@ixti
Copy link
Contributor

ixti commented Jul 4, 2013

Sorry, but I don't think it should go into core. if you need a custom <script> or <link> tags (with custom attributes) you can use {% asset_path %} Liquid tag:

<link data-turbolinks-track rel="stylesheet" type="text/css" src="{% asset_path app.css %}">
<script data-turbolinks-track type="text/javascript" src="{% asset_path app.js %}"></script>

Related: #30

@ixti ixti closed this Jul 4, 2013
@naan naan deleted the turbolinks branch July 4, 2013 01:15
@naan
Copy link
Author

naan commented Jul 4, 2013

Didn't know that there's a way to set custom attributes. Thank you!

@ixti
Copy link
Contributor

ixti commented Jul 4, 2013

Yeah, {% javascript %} and {% stylesheet %} are just dummy helpers for "most cases". And with {% asset_path %} you can do anything you want - as it just returns a proper asset URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants