Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def signup(xhtml: NodeSeq): NodeSeq = {
- val user = new User
- bind("f", xhtml,
- "firstName" -> SHtml.text(user.firstName, user.firstName = _),
- "lastName" -> SHtml.text(user.lastName, user.lastName = _),
- "nickName" -> SHtml.text(user.nickName, user.nickName = _),
- "password" -> SHtml.password("", user.password = _),
- "passwordConfirmation" -> SHtml.password("", user.passwordConfirmation = _),
- "send" -> SHtml.submit("Sign up", () => {
- user.register match {
- case Errors(e) => S.error(user.errors.fullMessages.map(e => <li>{e}</li>))
- case _ =>
- S.notice("User created")
- S.redirectTo("/")
- }
- })
- )
- }
Add Comment
Please, Sign In to add comment