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
测试创建一个article
欢迎光临 黑色海岸线论坛 (http://bbs.thysea.com/) | Powered by Discuz! 7.2 |