Reputation: 9548
Is it possible to route directly to a template using the routes file?
I am looking for an entry like this,
GET /template/main/*param views.html.main(param)
or something similar. Currently I am forwarding to an action to fetch the template.
Edit: Indicated param as well, so that the requirement is clear.
Upvotes: 0
Views: 551
Reputation: 315
If you have scala dynamic templates you need a controller for serve them and call in it a template.render() method, so it renders to html.
Upvotes: 1
Reputation: 749
Use some other web framework that will suit your needs better. It seems you use Play but dont really want to since you want to do things not intended to be done by Play...
Upvotes: 0
Reputation: 1841
If you want to directly route an URL to a template, then it's not a template but a static HTML file. You can have it in "/public/..." but, I don't know if it's possible to have it somewhere else.
Otherwise, you can still just have one line of code in the controller:
def myAction = Action(Ok(views.html.main.render()))
Upvotes: 1