play-formnolia


License

License

Categories

Categories

ORM Data
GroupId

GroupId

com.iterable
ArtifactId

ArtifactId

play-formnolia_2.11
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

play-formnolia
play-formnolia
Project URL

Project URL

https://github.com/Iterable/play-formnolia
Project Organization

Project Organization

Iterable
Source Code Management

Source Code Management

https://github.com/Iterable/play-formnolia

Download play-formnolia_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.iterable/play-formnolia_2.11/ -->
<dependency>
    <groupId>com.iterable</groupId>
    <artifactId>play-formnolia_2.11</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.iterable/play-formnolia_2.11/
implementation 'com.iterable:play-formnolia_2.11:0.0.1'
// https://jarcasting.com/artifacts/com.iterable/play-formnolia_2.11/
implementation ("com.iterable:play-formnolia_2.11:0.0.1")
'com.iterable:play-formnolia_2.11:jar:0.0.1'
<dependency org="com.iterable" name="play-formnolia_2.11" rev="0.0.1">
  <artifact name="play-formnolia_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.iterable', module='play-formnolia_2.11', version='0.0.1')
)
libraryDependencies += "com.iterable" % "play-formnolia_2.11" % "0.0.1"
[com.iterable/play-formnolia_2.11 "0.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
com.typesafe.play : play_2.11 jar 2.6.18
com.propensive : magnolia_2.11 jar 0.7.1

test (3)

Group / Artifact Type Version
com.typesafe.play : play-test_2.11 jar 2.6.18
be.venneborg : play26-refined_2.11 jar 0.3.0
org.scalatest : scalatest_2.11 jar 3.0.5

Project Modules

There are no modules declared in this project.

play-formnolia

Travis CI Maven

A project to automatically generate and validate Play forms using Magnolia.

Example

// Add the required imports:
import com.iterable.formnolia.SafeForms._
import play.api.data.format.Formats._

// Create a case class representing the form:
case class UserData(
  username: String,
  firstName: String,
  lastName: String,
  avatarUrl: Option[String]
)

// Generate the form and bind it in a Play action (or elsewhere).
newForm[UserData].bindFromRequest().fold(
  { formWithErrors =>
    BadRequest(s"Errors: ${formWithErrors.errors}")
  },
  { userData =>
    Ok(s"Got $userData")
  }
)
com.iterable

Iterable

Versions

Version
0.0.1