mandubian / play-crud-siena

A module for the Play! web framework providing a CRUD mechanism when using Siena DB APIs.
16 stars 3 forks source link

"No route found" when add new object #3

Open codeninja-ru opened 12 years ago

codeninja-ru commented 12 years ago

Hello. I'm trying to create a new object and got the error.

No route found

No route able to invoke action AdminComment.show with arguments {} was found.

In {module:crudsiena-2.0.2}/app/views/tags/crud/navigation.html (around line 7)

screenshot http://imm.io/esi2

seems like there is error at line:

  • > ${_caller.object?.toString()?.escape()?.raw()}
  • mandubian commented 12 years ago

    Hi,

    Does it end with same error for all your models or just this one?

    Could you give your model to see if it could come from it ? (it can be a bug in play-crud-siena also) It looks _caller.object is empty...

    Pascal

    On Thu, Jan 12, 2012 at 8:29 AM, codeninja < reply@reply.github.com

    wrote:

    Hello. I'm trying to create a new object and got the error.

    No route found

    No route able to invoke action AdminComment.show with arguments {} was found.

    In {module:crudsiena-2.0.2}/app/views/tags/crud/navigation.html (around line 7)

    screenshot http://imm.io/esi2

    seems like there is error at line:

  • > ${_caller.object?.toString()?.escape()?.raw()}

  • Reply to this email directly or view it on GitHub: https://github.com/mandubian/play-crud-siena/issues/3

    codeninja-ru commented 12 years ago

    it's for all models. When I delete line #7 from {module:crudsiena-2.0.2}/app/views/tags/crud/navigation.html all work well.

    I use play 1.2.3 for GAE

    dependencies.yml

    codeninja-ru commented 12 years ago

    my model https://gist.github.com/1604800

    pschlup commented 12 years ago

    Same thing happens to me if the ID is a String and not autoincremented. This fails (code is in Scala, using v2.0.3 and siena module v2.0.7):

    @Id(Generator.NONE) @NotNull var id: String = ""

    But this works, everything else is the same:

    @Id(Generator.AUTO_INCREMENT) var id: Long = 0

    Error is "No route able to invoke action Countries.show with arguments {id=} was found" in line 7 of navigation.html:

    href="@{show(play.modules.siena.SienaModelUtils.keyValue(_caller.object))}">${_caller.object?.toString()?.escape()?.raw()}

    Edit: Solved this by locally overriding layout.html and removing the navigation section. I also pointed directly to my local jquery 1.8.2 since the module links to jquery 1.5.2 and doesn't provide it, crashing because of it.