% @model.form_attributes.each do |entries| %> <% entries.each do |attribute, properties| %> <% field_type = properties['type'] %> <% properties = properties.except('type') %> <% if field_type == 'adminpanel_file_field' %> <% if !defined? remote_request %> <%= content_tag :div, :class => 'file-collection-container', :data => {:max => properties['max-files'].nil? ? 0 : properties['max-files'] } do %> <%= f.fields_for(attribute) do |builder| %> <%= render 'shared/image_fields', :f => builder %> <% end -%> <%= link_to_add_fields t('Add Image'), f, attribute %> <% end %> <% end %> <% elsif field_type == 'belongs_to' %> <% if !defined? remote_request %> <% args = properties.except('model') %> <%= f.select(attribute, (@collections["#{properties["model"]}"].collect{|resource| [resource.name, resource.id]}), args) %> <% if(properties['remote_resource'].nil? || properties['remote_resource']) %> <%= render 'shared/create_remote_resource_button', belongs_request: true, remote_resource_name: properties['model'] %> <% end %> <% end %> <% elsif field_type == 'has_many' %> <% if !defined? remote_request %>