Skip to content

Default segment specification in named routes #52

@GetContented

Description

@GetContented

I'd like to be able to specify a route similar to this:

(defroute my-path "/design/:filter-name/:id" [filter-name id]
  ; do something
  )

(my-path {:id 5}) ; currently yields "/design/:filter-name/5", but I'd like to be able to specify a default for filter-name

And have the generated named path be able to specify default values to the parameters, rather than a keyword being used. I'm not really sure how this could be accomplished.

This is pretty closely related to having trailing slashes being elided, too... these two use-cases seem to be common enough that a solution would be really great to have in secretary itself, perhaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions