@(loggedUser: Option[User], loginInfo: Option[LoginInfo], cards: Seq[Card], addCardInput: AddCardInput)(implicit request: RequestHeader, messages: Messages)
@category(card: Card) = {
<tr>
<td>
@b3.form(routes.DeckBuilder.deleteCard()) {
@helper.CSRF.formField
@b3.submit('class -> "btn btn-primary") { Submit }
}
</td>
</tr>
}
@views.html.templates.mainApp(Messages("app.title"), tab = "index", loggedUser = loggedUser, loginInfo = loginInfo)) {
<h2 class="text-primary">Your Cards</h2>
<p class="lead">
@loggedUser.map { user =>
<div class="modal-body">
<table class="table">
<tbody>
@cards.map(grouped => category(grouped))
</tbody>
</table>
</div>
}.getOrElse {
@Html(Messages("index.notLogged", routes.Auth.signIn, routes.Auth.startSignUp)) <br/>
@Html(Messages("index.resetPassword", routes.Auth.startResetPassword))
}
</p>
}
The above code produces error
could not find implicit value for parameter fc: views.html.b3.B3FieldConstructor
The error points to the line where I am building the submit button. I'm aware that it requires the implicit field constructor and in another file, I've done this successfully, but that was where the form wasn't in a helper method.
You just need to declare the implicit field constructor at the top of your partial (I know - it seems contradictory to declare an implicit.. but this works):