martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
405 stars 23 forks source link

Make name parameter optional for included path #114

Closed treagod closed 1 year ago

treagod commented 1 year ago

This commit makes the name parameter for included maps optional. In addition a namespace can be added to a map.

Example

ARTICLE_ROUTES = Marten::Routing::Map.draw(:article) do # :article is the namespace
  path "/", ArticleList, name: "list"
  path "/new", ArticleNew, name: "new"
end

Marten.routes.draw do
  path "/articles", ARTICLE_ROUTES # will add article:list and article:new
end

Closes #108

treagod commented 1 year ago

I don't know why, but shards install raises a compiler bug in the sql checks. Seems to be linked to ameba?

Edit: seems to be in the nightly builds