Skip to content

Instantly share code, notes, and snippets.

@molekilla
Created March 24, 2012 14:25
Show Gist options
  • Save molekilla/2183479 to your computer and use it in GitHub Desktop.
Save molekilla/2183479 to your computer and use it in GitHub Desktop.
Escuelita de Scala - Parte 3 - Controller
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import services.RegPubServices
object Application extends Controller {
def index = Action {
Ok(views.html.index("Hola Escuelita de Scala"))
}
def about = Action {
Ok(views.html.about())
}
def search(searchText:String) = Action {
val searchResults = RegPubServices().searchDocuments(searchText)
Ok(searchResults)
}
def findByName(searchText:String) = Action {
val searchResults = RegPubServices().findByName(searchText)
Ok(searchResults)
}
def typeahead(searchText:String) = Action {
val searchResults = RegPubServices().searchTypeahead(searchText)
Ok(searchResults)
}
def show(ficha:String) = Action {
TODO
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment