Skip to content

Commit

Permalink
jump to v0.10.0 and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tminglei committed Jul 19, 2015
1 parent 5ca1b4d commit c86b1fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Install & Integrate
--------------------
To use `form-binder`, pls add the dependency to your [sbt](http://www.scala-sbt.org/ "slick-sbt") project file:
```scala
libraryDependencies += "com.github.tminglei" %% "form-binder" % "0.9.0"
libraryDependencies += "com.github.tminglei" %% "form-binder" % "0.10.0"
```

Then you can integrate it with your framework to simplify normal usage.
Expand All @@ -50,11 +50,10 @@ trait MyFormBindSupport extends I18nSupport { self: ScalatraBase =>
import MyFormBindSupport._

before() {
request(BindMessagesKey) = Messages(locale, bundlePath = "i18n/bind-messages")
request(BindMessagesKey) = Messages(locale, bundlePath = "bind-messages")
}

def binder(implicit request: HttpServletRequest) =
expandJsonString(Some("json")) >-: FormBinder(bindMessages.get).withErr(errsToJson4s)
def binder(implicit request: HttpServletRequest) = FormBinder(bindMessages.get, errsTree())

///
private def bindMessages(implicit request: HttpServletRequest): Messages = if (request == null) {
Expand All @@ -68,7 +67,7 @@ Then mix it to my xxxServlet, and use it like this,
```scala
import com.github.tminglei.bind.simple._

class FeatureServlet extends ScalatraServlet with MyFormBindSupport {
class SampleServlet extends ScalatraServlet with MyFormBindSupport {

get("/:id") {
val mappings = tmapping(
Expand Down
2 changes: 1 addition & 1 deletion integrations/scalatra/MyFormBindSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait MyFormBindSupport extends I18nSupport { self: ScalatraBase =>
import MyFormBindSupport._

before() {
request(BindMessagesKey) = Messages(locale, bundlePath = "i18n/bind-messages")
request(BindMessagesKey) = Messages(locale, bundlePath = "bind-messages")
}

def binder(implicit request: HttpServletRequest) = FormBinder(bindMessages.get, errsTree())
Expand Down

0 comments on commit c86b1fc

Please sign in to comment.