문제

As I read this question occurs quite often, but I don't get it. So sorry for my noobishness.

Got a subproject called "subproject1"

In conf/routes I call it with -> /subproject1/ subproject1.Routes

In subproject1.Routes there is an action like:

GET   /admin/rater   subproject1.controllers.Application.rater(id: Int ?= 0)

There is a view like stuff.scala.html and a link like:

<a href='@vvv.controllers.routes.Application.rater()?id=@page.getId()'>asdf</a>

Play says value Application is not a member of object vvv.controllers.routes, But the action is defined in Class "Application"

The route should be like vvv.controllers.vvv.routes.Application.rater().. but that's also an error.

Any suggestions are highly appreciated!

도움이 되었습니까?

해결책

An explanation for subprojects can be found here.

Per your example, you should define the routes in your subproject as

GET    /admin/rate    controllers.subproject1.Application.rater(id: Int ?= 0)

Then in the view you would call the route as follows (assuming you pass an id variable to the template):

<a href='@controllers.subproject1.routes.Application.rater(id)'>asdf</a>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top