% content_for :javascript_includes do %> <%= javascript_include_tag "/assets/ckeditor/ckeditor" %> <% end %> <%= simple_form_for [:admin, @tenant], wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_collection, file: :horizontal_file } do |f| %> <%= f.error_notification %> <%= f.input :name %> <% index = 0%> <%= f.simple_fields_for :tenant_images do |p| %> <% if p.object.new_record? %> <%= p.input :image, as: :file, input_html: { multiple: true, name: "tenant[tenant_images_attributes][][image]" } %> <% else%> <% if index == 0%>