You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had some trouble to upgrade to sprockets 4 so I want to share our solution.
Include this MP in your application.rb (xray-rails must allready be required)
config.after_initialize do
if Gem::Version.new(Xray::VERSION) > Gem::Version.new('0.3.2')
raise('This monkey patch is no longer necessary.')
end
Xray::Engine::JavascriptPreprocessor.class_eval do
# See also https://github.com/brentd/xray-rails/issues/88
# This is fixed in https://github.com/brentd/xray-rails/pull/103
def self.run(filename, source, context)
path = Pathname.new(context.filename).to_s
if path =~ /^#{Rails.root}.+\.(jst)(\.|$)/
Xray.augment_template(source, path)
else
source
end
end
end
end
This will no longer be necessary with the next release of xray-rails.
You could include
Add = javascript_include_tag 'xray', nonce: true if Rails.env.development? as last element of the head tag.
You need to make sure jQuery is already available.
Add = render partial: '/xray_bar' if Rails.env.development? as first element of the body tag.
This will no longer be necessary if this MR is merged #101
Please let me know if you made some different changes.
The text was updated successfully, but these errors were encountered:
We had some trouble to upgrade to sprockets 4 so I want to share our solution.
Include this MP in your
application.rb
(xray-rails must allready be required)This will no longer be necessary with the next release of xray-rails.
You could include
Add
= javascript_include_tag 'xray', nonce: true if Rails.env.development?
as last element of the head tag.You need to make sure jQuery is already available.
Add
= render partial: '/xray_bar' if Rails.env.development?
as first element of the body tag.This will no longer be necessary if this MR is merged #101
Please let me know if you made some different changes.
The text was updated successfully, but these errors were encountered: