Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework tutorial: Cannot resolve symbol 'routes'

I am following the play tutorial and I am stuck at roughly 9 mins. The routes file is not getting resolved I did the same thing as shown in the tutorial but still doesn't work.

package controllers;
import models.Bar;
import play.core.Router;
import play.data.Form;
import play.mvc;
import play.*;
import play.Routes;
import views.html.indes;
public class Application extends Controller {

public static Result index() {
    return ok(index.render("Hello"));
}

public static Result addBar(){
    Bar bar = Form.form(Bar.class).bindFromRequest().get();
    bar.save();
    return redirect(routes)
    }

}
like image 555
Sanmathi Avatar asked Apr 12 '14 10:04

Sanmathi


Video Answer


2 Answers

Project Structure -> Modules -> Dependencies -> + -> JAR or directories -> target/scala-#.##/classes_managed

Marking this directory as Sources Root/Generated Sources Root did not work for me, as mentioned in some other S/O posts

like image 55
Kevin Avatar answered Sep 26 '22 06:09

Kevin


It was localhost:9000 itself. I dint try running the server again. Actually the code is not able to identify the routes file which is under conf. I am just trying to replicate whatever is shown in the tutorial but it's not happening!

like image 30
Sanmathi Avatar answered Sep 25 '22 06:09

Sanmathi