Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails console equivalent with play framework 2.4.x?

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 ?

like image 542
Bahaïka Avatar asked Jan 21 '16 16:01

Bahaïka


2 Answers

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

like image 131
Jakub Jatczak Avatar answered Nov 01 '22 21:11

Jakub Jatczak


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.

like image 34
Dani Avatar answered Nov 01 '22 21:11

Dani