Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to create an Admin section in Grails

Hy,

I'm wondering what's the best way to create an Admin (backend) section in a Grails app ?

I want to create an "Admin" folder in the "controllers" folder of Grails to put all my admin controllers. But then will I have to create manually the URL mapping for each Admin controller?

I have already generated all my frontend GSP with the genernate-all command which takes a Domain Class but know how can I generate my CRUD for my admin section (with the same domain class). Am I screwed ?

Thanks a lot for your tips!

like image 241
Benoit Wickramarachi Avatar asked Jul 15 '09 19:07

Benoit Wickramarachi


1 Answers

My preference for this is to have a separate application for admin. Stick all of your domain classes in a plugin and install that plugin into both the admin application and the consumer appilcation.

That way, you can tweak the controllers to your hearts content and not worry about end users hitting them. Shared services can also be in the domain plugin.

There's a special file that you can put in your grails-app/conf called BuildConfig.groovy where you can specify "local" plugins like the domain plugin that are automatically brought into the classpath without having to package/install the plugin. Makes it super easy.

like image 151
Ted Naleid Avatar answered Oct 06 '22 14:10

Ted Naleid