brentd / xray-rails

☠️ A development tool that reveals your UI's bones
MIT License
1.22k stars 79 forks source link

Handle empty templates #77

Open tobiashm opened 8 years ago

tobiashm commented 8 years ago

If the template returns without rendering anything, Xray.augment_template should not be called.

The scenario might be a conditional return statement in a partial, to avoid it being rendered in some cases.

Alternatively, Xray.augment_template could return immediately if the input source is nil?

mattbrictson commented 8 years ago

Thanks for the PR!

Is there any way I can test this to verify the behavior? For example, could you provide a gist containing a sample controller + view?

Ideally I would like to include a test in the gem itself; if you have any thoughts on how that could be done, let me know and I can help you include it in this PR.

Finally, in order to merge I need to you to add a CHANGELOG entry explaining your contribution.

Thanks!

jesperronn commented 7 years ago

@tobiashm @mattbrictson would be nice to merge this. @tobiashm any updates on creating a test/gist for this?