ejholmes / active_admin_editor

Rich text editor for Active Admin using wysihtml5.
MIT License
184 stars 134 forks source link

Not working with nested attributes #70

Open Awatatah opened 7 years ago

Awatatah commented 7 years ago

Maybe I'm missing some thing but let's say I have the following layout where I have :text in a nested field using as: :html_editor. This does not work. It only works if it's not a nested attribute i.e. :name. Any ideas how to fix?

form do |f|
    f.inputs "Section Details" do
        f.semantic_errors
        f.input :district, :collection => AbqDistricts::District.all.map {|u| [u.name, u.id]}, :include_blank => false
        f.input :name
        para "Do not use shortened urls e.g. 'http://bit.ly/1dNVPAW' for images. Only use full urls e.g. 'http://www.somewhere.com/someimage.jpg'", style: 'color:red;padding-left:10px;'
        f.inputs 'List Items' do 
            f.has_many :list_items do |item|
                item.input :item_type, as: :select, collection: ["", "list_item", "media", "text"], :include_blank => false, input_html: {onchange: "itemSelected(this)"}
                item.input :text, as: :html_editor
                item.input :link, input_html: {class: "item-select-type"}
            end
        end
    end
    f.actions
    end
end