We all require a rich text editor in our applications whether it’s for composing a mail or just for writing a “about me” section of a profile. I’m going to show you how to integrate one such editor in your application. We’ll use CKeditor which is a WYSIWYG (What you see is what you get) type editor. So, let’s get started. Follow these simple steps:

Step 1) CKeditor is available as a grails plugin. So, our first step is to install the plugin. This is done by simply including the following string in your BuildConfig.

plugins {
    compile ":ckeditor:3.6.2.2"
}

Step 2) Now, declare the following resource tag in your page’s <head> tag on which you want to put the rich text editor.

Step 3) This is the final step. Just put the following tag in the <g:form> tag like <g:textArea> tag and you are done.

&lt;g:form action="processProfileSubmission" class="form-horizontal" method="POST"&gt;
    &lt;ckeditor:editor name="aboutMe" height="400px" width="80%"&gt;
        ${"About me..." }
    &lt;/ckeditor:editor&gt;
    &lt;g:submitButton name="Submit" class="btn btn-inverse" title="submit" /&gt;
&lt;/g:form&gt;

I hope, this simple tutorial helps you.