If you have part of your application that need to be under a subdomain, there's currently no way to use link() to go to the action with that subdomain.
We could do this:
link to: Admin::Dashboard.with(subdomain: "admin")
Or alternatively, we could make actions with subdomains auto redirect?
# something like this?
require_subdomain "admin", auto_redirect: true
# this would show "/dashboard", but then auto redirect to admin.whatever.site/dashboard
link to: Admin::Dashboard
Though.... thinking about it, that second idea might not be good because then EVERY link would always 302 :thinking:
I'm mainly looking for a way where I can say some links go to subdomain pages, and some don't.
If you have part of your application that need to be under a subdomain, there's currently no way to use
link()
to go to the action with that subdomain.We could do this:
https://github.com/luckyframework/lucky/blob/main/src/lucky/route_helper.cr
https://github.com/luckyframework/lucky/blob/8d0681a086ff0985e58a319f9ded9002a17eb4e8/src/lucky/routable.cr#L317
Or alternatively, we could make actions with subdomains auto redirect?
Though.... thinking about it, that second idea might not be good because then EVERY link would always 302 :thinking:
I'm mainly looking for a way where I can say some links go to subdomain pages, and some don't.