-
Notifications
You must be signed in to change notification settings - Fork 79
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
Need ability to disable Xray entirely for a given controller action #75
Comments
Hi, thanks for the report! To be honest, I've never used the It is quite possible that this feature is broken, either in general or for Rails 3.2 specifically. I would appreciate any additional investigation you could provide on this. |
Just to be clear: my expectation of this feature based on the README is that passing Intuitively this makes sense for a partial render, but it is not entirely clear to me what is supposed to happen if you pass What is your expectation? |
@mattbrictson: Thanks for your response. I was expecting to pass Reading through the code, I found this line in engine.rb that seems to handle this option, but I don't see anywhere where I also found this test. I'm not too familiar with the inner-workings of xray, so where is the x-ray html interjected into the view? Is it the (Tagging one of my other developers on this: @lebrauncom) |
So, my understanding is that xray-rails does two different things wrt HTML injection:
Does this help shed some light on what is happening? To my knowledge there is no way to entirely disable the xray middleware for a given |
Yes, this is happening whether or not
What you describe, might be OK but the xray comments are still being passed into the HTML when |
@mattbrictson: Follow up question: Where does X-Ray inject the HTML comments? The middleware.rb reference above seems to just be for the x-ray bar and assets. |
Comments are injected using Lines 81 to 93 in 4c050c7
This happens whenever a view template is rendered, which is accomplished by a monkey patch registered by Lines 31 to 53 in 48ae158
|
Was there any resolution to this problem? I'm encountering it right now |
@jpegjames @pcragone the solution is to use the locals parameter, like this: render locals: {xray: false} As far as I can tell, you use xray: false when rendering a partial: render partial: 'foo', xray: false and use the locals parameter otherwhise. |
To reiterate: the |
I'm re-classifying this issue as a feature request: namely, the ability to disable Xray entirely for a given controller action. |
xray: false
not disabling xray for views
@mattbrictson: Thanks for updating the README. I think that caused some confusion as it seemed like it could be disabled completely for a given page/request. I would personally love to see that feature, but we make heavy use of partials so this may still be a suitable workaround. |
I would love to see this available. We have modal JS library that expects one root element that is broken by x-ray instrumentation. |
Maybe, I'm missing something, but I have view that I need to disable xray on. In the controller, I've passed
render xray: false
, and it does prevent it from rendering.I've tried a bunch of combinations. This particular controller action has no other functionality. Here's everything that I've tried:
Any thoughts? Is this only not working for me? I've tried it on several different actions and controllers, but it initiates every time.
I'm running Rails 3.2.21 and I just updated to xray-rails 0.1.21. I am also using Turbolinks, but have tried by refreshing the page each time and it still stays enabled.
The text was updated successfully, but these errors were encountered: