sprockets-rails icon indicating copy to clipboard operation
sprockets-rails copied to clipboard

Enable 'debug: true' option on asset tag helpers

Open rlue opened this issue 7 years ago • 1 comments

From Section 3.3 of the Edge Guides on the Asset Pipeline:

Debug mode can also be enabled in Rails helper methods:

<%= stylesheet_link_tag "application", debug: true %>
<%= javascript_include_tag "application", debug: true %>

The :debug option is redundant if debug mode is already on.

But per lines 140 and 169 of Sprockets::Rails::Helper:

if options["debug"] != false && request_debug_assets?

This conditional allows debugging to be explicitly disabled on a tag when Rails.application.config.assets.debug == true, but not vice versa.

This PR uses the naive solution (simply adding || options["debug"]) rather than performing more extensive refactoring, since comments indicate that this method is slated for deprecation anyway.

rlue avatar Jan 07 '18 13:01 rlue

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

rails-bot avatar Jan 07 '18 13:01 rails-bot