Skip to content
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

Fix t prefixes not being assigned properly #86

Closed
wants to merge 1 commit into from
Closed

Conversation

kaspth
Copy link
Contributor

@kaspth kaspth commented Apr 10, 2023

This fixes a change I made to our t-prefixes that broke things: overriding ActionView::Base#capture meant that we'd fire on helper calls too — and extract from their block location.

Note: we're leveraging Rails 6.1+'s @current_template.virtual_path to avoid needing to muck with block source_locations or view_paths,
Rails has already figured that out for us.

This fixes two changes I made to our t-prefixes that broke things:

1. overriding `ActionView::Base#capture` meant that we'd fire on helper calls too — and extract from their block location.
2. overriding `ActionView::Base#render` instead of `ActionView::PartialRenderer#render` meant that we wouldn't accurately assign the prefix
   to each render in a collection.

Note: we're leveraging Rails 6.1+'s `@current_template.virtual_path` to avoid needing to muck with block source_locations or view_paths,
Rails has already figured that out for us.
@kaspth kaspth force-pushed the fix-t-prefix branch 3 times, most recently from d8aef12 to b3f6374 Compare May 23, 2023 16:30
@kaspth kaspth marked this pull request as draft June 20, 2023 16:47
@kaspth kaspth mentioned this pull request Jun 27, 2023
@kaspth kaspth closed this in #89 Aug 31, 2023
@kaspth kaspth deleted the fix-t-prefix branch September 11, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant