Rails console equivalent with play framework 2.4.x?
Asked Answered
C

2

8

I'm used to work on Ruby on Rails projects and to use the rails console command to test all my models before doing anything else. I've recently switched to the Play Framework 2.4.x due to some choices made where I work.

I'm searching for an equivalent of this console to test my models with the database I provided inside the application.conf (db.default.url). How can I do this ?

Little bonus question : if it exists, is there any way to integrate it with IntelliJ ?

Cowgirl answered 21/1, 2016 at 16:26 Comment(0)
V
1

Try running app from play console, should load all configs

Play framework 2.0 console

In InteliJ, play console should be found under 'tools'

Play console in InteliJ

Volant answered 24/1, 2016 at 17:29 Comment(0)
I
1

If you're managing your project with SBT then you'll should be able to run sbt console which is similar to the rails console, but different.

Check out the twitter Scala school tutorial: https://twitter.github.io/scala_school/sbt.html

Also note that the sbt console will not load your classes automatically like Rails does, you have to import any class you'll be using manually.

Inexperienced answered 25/1, 2016 at 17:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.