How to Create a Grails Application in IntelliJ IDEA ( First App )

Step 1 : Run Following Command :

  grails create-app app_name 
  
 cd app_name 

 grails run-app

Step 2 : Create Domain Class under a package

  grails create-domain-class com.firstApp.User

then, edit the domain User.groovy as given below:

  package com.firstApp

  class User 
  { 
     String username; 
     String password; 
     String email;
     static constraints = { 
         email email: true; 
     } 
  } 

Step 3 : Generate Controller

  grails generate-controller com.firstApp.User 
  static scaffold = true; // Write in UserController class 

Step 4 : Generate View

  grails generate-view com.firstApp.User

Step 5 : Run App

 grails run-app 








You can also clone my Example from GITHUB

git clone https://github.com/ketan-jft/FirstApp.git 
Powered by Blogger.