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

url-for needs unqualified keys? #29

Closed
mgerlach-klick opened this Issue Sep 26, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@mgerlach-klick
Contributor

mgerlach-klick commented Sep 26, 2018

Hey, what do you think of this:
Through EDN queries, all the results come back with qualified namespaces, for instance here's what i'm working on right now:
(q '[:pull [:brand/id :brand/url :brand/company :brand/last-visited :brand/name]])
now I want to url-for those brands, but currently I have to do this:
[:a {:href (url-for :view-brand {:id (:brand/id row)})}]

What if url-for, if it doesn't find the key it is looking for, automatically disqualifies the keys and looks there? This would allow a simple:
[:a {:href (url-for :view-brand row)}]

Cf. https://github.com/cjsauer/disqualified

@swlkr

This comment has been minimized.

Show comment
Hide comment
@swlkr

swlkr Sep 26, 2018

Collaborator

Oh wow yeah, that's really useful! Definitely going to unqualify those keywords very soon.

Collaborator

swlkr commented Sep 26, 2018

Oh wow yeah, that's really useful! Definitely going to unqualify those keywords very soon.

@mgerlach-klick

This comment has been minimized.

Show comment
Hide comment
@mgerlach-klick

mgerlach-klick Sep 26, 2018

Contributor

Or maybe turn it into :namespace_name and then i make the route go to :get "/view-brand/:brand_id" :brand.read/view :view-brand] or something to prevent conflicts. Just thinking out loud..

Contributor

mgerlach-klick commented Sep 26, 2018

Or maybe turn it into :namespace_name and then i make the route go to :get "/view-brand/:brand_id" :brand.read/view :view-brand] or something to prevent conflicts. Just thinking out loud..

@swlkr swlkr closed this in 0f0299e Oct 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment