Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to pass html/css options to rails_admin inputs?

I'm using rails_admin and I'd like to add a few custom styles to my admin section on some inputs. Is there any way to specify additional classes?

Something like:

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

I can't seem to find a comprehensive list of what options are available. I know I can specify hidden, visible, ckeditor true, and one or two other things.

I'm using some additional custom JS and CSS, but I need to be able to specify some CSS classes to make everything work the way I want.

Specifically, I'm using CKEditor, and would like to use multiple toolbars, one simple and one advanced. I've been able to config CKEditor fine, but I can't find a way to have Rails_admin use an alternate toolbar.

like image 259
ideaoforder Avatar asked Oct 07 '22 19:10

ideaoforder


1 Answers

You can use :html_attributes

https://github.com/sferik/rails_admin/blob/master/lib/rails_admin/config/fields/base.rb#L126

like image 57
Benoit B. Avatar answered Oct 10 '22 02:10

Benoit B.