小编ale*_*lex的帖子

simple_form集合包装器(无线电按钮):项目的双重封装

我想用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)

simple-form

8
推荐指数
2
解决办法
7418
查看次数

编辑rails gem而不重启服务器

Rails3:我克隆了一个现有的gem,以便在开发中修改它.我输入了我的gemfile:

gem'my_gem_name',: path =>'../gems/my_gem_name'

它工作正常,但每次我想编辑gem时,我都要重新启动我的rails服务器.有没有办法我不需要重启服务器?

对于视图/控制器/帮助器文件有设置,config.cache_classes = false但我无法找到类似的本地宝石.

gem refresh ruby-on-rails-3

5
推荐指数
1
解决办法
1512
查看次数

标签 统计

gem ×1

refresh ×1

ruby-on-rails-3 ×1

simple-form ×1