jquery-tmpl-rails
jquery-tmpl-rails copied to clipboard
fix sprockets configuration
Thanks @masarakki - this PR fixes the problem with Sprockets for me.
:+1: for getting the PR merged into the gem
Could someone provide an explanation of the issue and how this fixes it? I haven't use jQuery templates in forever, and I'm pretty rusty on Rails these days, for that matter.
@jimmycuadra I'm not the author, but I ran into this today while upgrading a legacy Rails app. Sprockets has made significant changes to how registration of new mime type handlers are registered.
This is the best example I found today: https://github.com/yasaichi/grease
This PR looks like it should work, but it doesn't for me. I tried some tweaking, using the Sprockets 4 syntax. But no luck, quite possibly because the templates I'm working with were written in haml
A further note -- the preferred way to set this up is no longer using an initializer, but putting something in config/application.rb
. I think that's what this PR is attempting to fix.
@jimmycuadra I came here trying to upgrade my gems to handle sprockets deprecations such as this:
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block in <class:Railtie> at /path/to/vendor/bundle/ruby/2.4.0/gems/jquery-tmpl-rails-1.1.0/lib/jquery-tmpl-rails/engine.rb:10)
That all being said, it looks like these changes now are calling for more than the current PR.
Am having a crack at committing the deprecated changes, if they pass our tests I'll file a PR :)