Reputation: 1154
I have a single input form in a play scala template:
@helper.form(action=routes.Application.searchResult()) {
<input type="text" name="userQuery" value="@userQuery">
}
and would like to pass an extra parameter, '@channel' to the searchResult action, which it takes as an optional argument.
@channel is passed as an argument to the current template. What's the simplest way to do this?
I tried replacing
routes.Application.searchResult()
with
routes.Application.searchResult(channel=channel)
with no success
Upvotes: 2
Views: 248
Reputation: 9168
Either you update the route to the action to pass parameter by there, or you use form mapping with corresponding parameter parser.
Upvotes: -1