Hi there,
I’m building a small phoenix application using phoenix 1.2.1 and plug 1.3.0.
In my phoenix app router, I’ve defined a route
get "/car/:name", CarController, :show
and I expect that in the show function of the CarController, the conn.path_params
map has the value %{"name" => "<TheValueGivenInTheUrl>"}
Unfourtunately, the map is always empty.
In the plug sources, the map conn.path_params is updated in the compile method of the Plug.Router
module (it seems to be the only place where this value is updated). But it seems that phoenix doesn’t use this compile function to specify the routes - I’ve set some trace output and the compile method doesn’t seem to be called in my application.
Am I doing something wrong or is this the intended behavior?
Or is there another way to get the path parameters?
I really need to know if a paramter is given in the query, the path or the body of a request.
Thanks