Hi guys.... Im at the point in grails that I have the "hello world" application working. But now I'm wondering.... what if I don't want any of the default "CRUD" stuff.... all my CRUD is, of course, specific to my business logic.
Is there a "hello world" application out there for grails that doesnt simply autogenerate a form for every table in my domain ? I need, like most developers, the ability to build custom pages without relying on google searching for templates ! Help !
How do I CUSTOMIZE grails to do more than CRUD ?
Thanks !
This message was edited 2 times. Last update was at by Bear Bibeault
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Write some controllers, commands, views, etc. that do what you want?
You don't customize Grails to do more than CRUD.
Grails help you to create CRUD for your domain entities but it isn't Grails only mission.
Grails after all is MVC based framework (like Stripes, Struts2 ..), do what ever you want, your keyboard is only the limit
jay vas
Ranch Hand
Joined: Aug 30, 2005
Posts: 405
posted
0
Great thanks I think my weakness is that I don't know Groovy, and thus, I cannot do Grails.
I believe that, at least in my experience, you REALLY need to understand GROOVY before you can do anything regarding grails.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
I didn't find that to be the case at all; for me it was more important to understand Spring and Hibernate so I could understand what was happening when things went awry.
I am with the OP, these products that create your CRUD, while they try to say unobtrusive so you can change it, it really isn't. I have tried a few already, and I always have major customization and I get a few done, but then there is always something that can't be done, or is very tightly coupled, so changing it is a real pain and you always forget something, so it take a real long time.
I am trying Grails right now, I just finished using Spring Roo, which is really cool, but again, when I got to the web layer, I couldn't figure out how to pull it out of the basic CRUD pages, because I needed to make better one to many pages etc. However, I think that problem will be easier with Grails since I have seen some of the one to many stuff and while not perfect for how I want, seems closer.
But that's more of a Grails issue; my point was only that you don't really need to know much about Groovy to create non-CRUD controllers, as the previous poster posted an example of.
First thing I do when/if I generate controllers and views is get rid of the pointless show view and remove the ID columns from the list views. Also, if you come up with something you like dealing with one-to-many crud screens, you can always create your own templates that Grails will use to generate your views, that way you don't have to customize them for every project.
BTW Mark, when you get to the point where you are trying to save the many side via indexed properties in your forms, ping me. I just went through a bunch of that today and got it all worked out. Planning a dzone article on the subject. The premise is I'm creating an Event and I want to add a bunch of Reminders to the event but I don't want to save them one at a time and I don't want to have to save the Event then go back and fill out Agenda forms. There's just a few gotches that I am going to write up.