【问题标题】:Is there a way to pass html/css options to rails_admin inputs?有没有办法将 html/css 选项传递给 rails_admin 输入?
【发布时间】:2012-08-28 18:36:56
【问题描述】:

我正在使用 rails_admin,我想在一些输入的管理部分添加一些自定义样式。有没有办法指定额外的类?

类似:

  configure :title, :string do
    css_class 'my-class'
    input_html {:class => 'my-class', :toolbar => 'my-toolbar'}
  end

我似乎找不到可用选项的完整列表。我知道我可以指定hiddenvisibleckeditor true 以及其他一两件事。

我正在使用一些额外的自定义 JS 和 CSS,但我需要能够指定一些 CSS 类以使一切按我想要的方式工作。

具体来说,我正在使用 CKEditor,并且想使用多个工具栏,一个简单的,一个高级的。我已经能够很好地配置 CKEditor,但我找不到让 Rails_admin 使用备用工具栏的方法。

【问题讨论】:

    标签: ruby-on-rails-3 ckeditor rails-admin


    【解决方案1】:
    【解决方案2】:

    还有css_class。所以你可以有类似的东西:

    field :your_field do
      css_class do
        # Be sure to not remove the original class 
        # set by #{self.name}_field
        "#{self.name}_field your_custom_class"
      end
    end
    

    【讨论】:

      猜你喜欢
      • 2011-12-02
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 2022-01-03
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多