Replace default `p` with something that doesn't conflict with `Kernel.p`.
andrewculver opened this issue · 4 comments
@kaspth originally proposed content
, but even if we wanted to use a longer word I don't think this one is it, because while it fits for the whole content.content_for
, it's a little less applicable to the content.helpers do |...|
and content.some_helper
type of usage.
I also think the brevity of p
was a plus, especially given how much it ends up being referenced in a view. That said, I don't think everyone necessarily wants that brevity, and that's OK. Whatever we come up with, maybe we have both a shorthand and a full version.
Two options that jump out at me are np
(short for Nice Partials) or pc
(short or partial context)... and maybe the long form in both instances would be partial
?
Either way, when we do this, we need to mark calls to p
as deprecated, and make it clear that it will go away when we release 1.0.
I'm leaning toward np
, despite the conflict with the original np
usage. 😬 But possibly this makes backwards compatibility impossible?
I think I could be convinced to just do partial
and skip the brief options.
Here's a draft version of the README updated with this change, so we can see how it feels. I think it's better? https://github.com/bullet-train-co/nice_partials/blob/features/partial-instead-of-p/README.md
Yeah, I'm quite partial (lol) to partial
. I think it's better than content
already, so let me do a PR before we swap other packages to e.g. content
or what not.