-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Make helper macros public #169
Conversation
Picking up the naming convo here: is the difference between HTML and value helpers one of safely escaping HTML? If so I'm thinking the method names should suggest that like Another possibility, if those are unclear, is two methods that could be chained like this: register_helper :pluralize
register_helper html_safe :local_time To be most consistent with Rails |
I don't think it has anything to do with escaping HTML output. It's about the intent behind the helper. When you call
|
Right, you’ll have HTML safety in either case. As @willcosgrove mentioned output helpers like |
Got it, those are good explanations, thanks! I think in Rails a Not sure what to name an |
I’d quite like to deprecate |
Why do you want to deprecate |
I think my last message confused What I mean by |
I guess it is a reasonable escape hatch. I’d at least like to burry it deep in the documentation. It’s the thing that seems to cause the most confusion for people using Phlex with Rails and I think it’ll be much simpler to point folks to these macros. |
I think it's reasonable to get rid of What I think might be confusing for people is to determine the difference between a value vs output helper, which is still a problem with the current |
I agree, and I would be in favor of a rename of the |
I think this is my last thoughts on naming after thinking about it for a few days and looking at some of the names in Rails source code. The It's the All things considered, if the PR was committed as-is, I think the names are reasonable. |
There’s no way I can think of that we could use to detect the difference. I get what you mean about have a “default” helper as just |
This PR consolidates the with and without capture block helper macros and makes them part of the public API available in
Phlex::SGML
andPhlex::CSV
classes asregister_value_helper
andregister_output_helper
.Closes #168