Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does play framework support Nested routes like rails?

Rails make It possible to map resources that are logically children of other resources In the URL for example

/magazines/:magazine_id/ads/:id show    display a specific ad belonging to a specific magazine

Is it possible to do this In Play?

like image 958
Ahmed Aswani Avatar asked Dec 11 '25 13:12

Ahmed Aswani


1 Answers

Play doesn't care if arguments represents some kind of relation or not, it's job for your controller.

Of course it is possible to do that:

GET /some/:parent/:child   controllers.Application.getRelated(parent: Long, child: Long)

in controller:

public static Result getRelated(Long parent, Long child) {
    return ok(SomeFinder(parent,child));
}
like image 66
biesior Avatar answered Dec 13 '25 08:12

biesior