<% block = properties['options'] args = properties.except('options') collection = block.call(f.object) if collection.class.to_s.demodulize == 'ActiveRecord_Relation' id_method = :id label_method = :name else id_method = :first label_method = :last end collection = options_from_collection_for_select( collection, id_method, label_method, @resource_instance.send(attribute) ) %> <%= f.select attribute, collection, { include_blank: true }, args %> <% if !is_modal && ( properties['remote_resource'].nil? || properties['remote_resource'] ) %> <%= render( 'adminpanel/shared/create_remote_resource_button', belongs_request: true, remote_model: attribute.gsub('_id', '') ) %> <% end %>