Grails
(1
(2
(3
幾分鐘后安裝完畢,grails
(4
(5
編輯Article.groovy
class Article {
String title
String content
Date CurrentDate
static constraints = {
title (blank:false)
content (blank:false,maxLength:2048)
}
}
(6
(7)
將:
<tr class="prop">
<td valign="top" class="name">
<label for="content">Content:</label>
</td>
<td valign="top" class="value ${hasErrors(bean:article,field:'content','errors')}">
<input type="text" id="content" name="content" value="${fieldValue(bean:article,field:'content')}"/>
</td>
</tr>
改為:
<tr class="prop">
<td valign="top" class="name">
<label for="content">Content:</label>
</td>
<td valign="top" class="value ${hasErrors(bean:article,field:'content','errors')}">
<fck:editor id='content' name='content' height="400" >${article.content}</fck:editor>
</td>
</tr>
修改FCKDemo\grails-app\views\article
將:
<tr class="prop">
<td valign="top" class="name">
<label for="content">Content:</label>
</td>
<td valign="top" class="value ${hasErrors(bean:article,field:'content','errors')}">
<input type="text" id="content" name="content" value="${fieldValue(bean:article,field:'content')}"/>
</td>
</tr>
改為:
<tr class="prop">
<td valign="top" class="name">
<label for="content">Content:</label>
</td>
<td valign="top" class="value ${hasErrors(bean:article,field:'content','errors')}">
<fck:editor id='content' name='content' height="400" >${article.content}</fck:editor>
</td>
</tr>
(8
在瀏覽器下輸入:http://localhost:8080/FCKDemo
測(cè)試創(chuàng)建一個(gè)article