我想用simple_form重现这个单选按钮的单选按钮,以便使用http://semantic-ui.com/语法使simple_form工作:
<div class="grouped inline fields">
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="fruit" checked="">
<label>Apples</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="fruit">
<label>Oranges</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="fruit">
<label>Pears</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="fruit">
<label>Grapefruit</label>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
所以我准备了一个自定义包装器:
config.wrappers :semantic_radios, tag: 'div', class: "grouped fields", error_class: 'error', hint_class: 'with_hint' do |b|
b.use :html5
b.use :label
b.use :input
end
Run Code Online (Sandbox Code Playgroud)
设置一些选项:
config.item_wrapper_tag …Run Code Online (Sandbox Code Playgroud) Rails3:我克隆了一个现有的gem,以便在开发中修改它.我输入了我的gemfile:
gem'my_gem_name',: path =>'../gems/my_gem_name'
它工作正常,但每次我想编辑gem时,我都要重新启动我的rails服务器.有没有办法我不需要重启服务器?
对于视图/控制器/帮助器文件有设置,config.cache_classes = false但我无法找到类似的本地宝石.