Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix methods in generated routes to use brackets for empty parameter list #10364

Closed
mkurz opened this issue Jun 29, 2020 · 1 comment
Closed

Comments

@mkurz
Copy link
Member

mkurz commented Jun 29, 2020

Methods called like

HomeController_1.index

need to be called like

HomeController_1.index()

instead.

See

@mkurz mkurz added this to the Play 2.8.3 milestone Jun 29, 2020
@mkurz mkurz removed the triage label Jul 10, 2020
@octonato octonato modified the milestones: Play 2.8.3, 2.8.4 Oct 26, 2020
@ignasi35 ignasi35 modified the milestones: 2.8.4, 2.8.5, 2.8.6 Nov 4, 2020
@ennru ennru modified the milestones: 2.8.6, 2.8.7, 2.8.8 Dec 9, 2020
@mkurz mkurz removed this from the 2.8.8 milestone Feb 1, 2021
@mkurz
Copy link
Member Author

mkurz commented Feb 1, 2021

Actually, there is no bug in Play...
If you run in this problem make sure the route defined in conf/routes matches the action method.

E.g. if you have in your routes file:

GET     /                           controllers.HomeController.index

then the action method also should not have parentheses:

def index = Action {...

The other way round it works as well, you have to add parentheses to both:

GET     /                           controllers.HomeController.index()
def index() = Action {...

Right now the play-scala seed project is "broken", I fixed that: playframework/play-scala-seed.g8#149

@mkurz mkurz closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants