Вопрос

This is a very basic thing and I have no idea why am not able to do this. I am using Grails 2.3.5

I have a domain class com.trail.AuditTrail and I want it scaffolded views. So, here are the steps I followed:

  • ran grails create-controller com.trail.AuditTrail, this returned a message saying it generated:

    grails-app/controller/trail/AuditTrailController

    grails-app/views/auditTrail (just the folder!)

    It also created AuditTrailControllerSpec.groovy.

  • Then I added the line static scaffold = true in the Controller.

  • Then ran generate-views to create the views, but nothing got created !

IMPORTANT: In fact grails says that there is no command called as generate-views. When I did grails help it didn't list generate-views. So, I thought may be 2.3.5 doesn't have the command and tried generate-all. This too failed. To my surprise, grails help didn't show up generate-all too !

Then I found this bug: https://jira.grails.org/browse/GRAILS-10530. So, I tried clean, refresh-dependencies, compile and then generate-all. But still the same problem.

I thought my local grails setup is messed up. So, asked my colleague. He too sees the same problems.

My problem is I am not able to create the default template GSPs out of the domain.

Это было полезно?

Решение

Scaffolding functionality was extracted from Grails core in 2.3, so you need to install scaffolding plugin for Grails 2.3.5 to be able to use generate-all, generate-views GANT scripts.

P.S. I suggest you to switch to Grails 2.3.6 or 2.3.7. For more details take a look at this article http://www.gopivotal.com/security/cve-2014-0053

Другие советы

for that right click on action then click on generate view

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top