我正在为红矿项目管理系统开发一个插件。为了配置插件,我使用框架提供的部分设置。我需要存储一个布尔值,这个值应该使用复选框来设置和取消设置。
而
<input type="text" id="settings_mytext"
value="<%= settings['mytext'] %>"
name="settings[mytext]"
>适用于字符串和数字值,以下内容不适用于布尔值或任何值。
<input type="checkbox" id="settings_myboolean"
checked="<%= settings['myboolean'] %>"
value="<%= settings['myboolean'] %>"
name="settings[myboolean]"
>那么,有谁知道如何使用Redmine提供的插件设置页面来存储复选框的选中状态呢?
谢谢你的帮助。
发布于 2015-02-03 11:24:59
试试这个道路
<p>
<label>Oauth authentification:</label>
<%= check_box_tag "settings[oauth_authentification]", true, @settings[:oauth_authentification] %>
</p>https://stackoverflow.com/questions/28296816
复制相似问题