I'm following a tutorial of the Play Framework but I occurred in a problem, I wrote this object:
package controllers
import play.api.mvc._
object Tickets extends Controller {
def ticketsAvailable = Action { request =>
val availableTickets = 1000
Ok(availableTickets.toString)
}
}
and then add the routes:
GET /tickets/available/ controllers.Tickets.ticketsAvailable
but when I compiled and received this error:
type Tickets is not a member of package controllers
Anyone can help me with an example of how i can fix this problem?
Thanks
Change your object
to a class
, ie.
class Tickets extends Controller {
And of course Tickets.scala
should be packaged under app/controllers
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With