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

Filter ActionView output with Nokogiri #179

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

joeldrapper
Copy link
Collaborator

No description provided.

@joeldrapper joeldrapper changed the title Filter output helpers with Nokogiri Filter ActionView output with Nokogiri Mar 23, 2024
@joeldrapper
Copy link
Collaborator Author

Note, we can add fast paths for some of the output helpers with predictable output. For example, link_to has a predictable output and we know where to find the id in the arguments. Our adapter can look for that without having to parse anything.

# @!method link_to(...)
# @return [nil]
register_output_helper :link_to
def link_to(*args, **kwargs, &block)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably worth making a macro for this, since there are a lot of helpers that take an id as a keyword argument. A few other helpers, such as turbo_frame_tag take an id as a positional argument.

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.

1 participant