active_admin_editor icon indicating copy to clipboard operation
active_admin_editor copied to clipboard

Not working with nested attributes

Open Awatatah opened this issue 8 years ago • 0 comments

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

Awatatah avatar Feb 06 '17 17:02 Awatatah