app/views/admin/communication/extranets/contacts/_toggle.html.erb
<%
connected = @extranet.connected?(about)
path = toggle_admin_communication_extranet_contacts_path(
extranet_id: @extranet.id,
object_id: about.id,
object_type: about.class,
)
%>
<input class="form-check-input"
type="checkbox"
name="connection"
value="connect"
id="checkbox-<%= about.id %>"
data-remote="true"
data-method="post"
data-url="<%= path %>"
<% if connected %> checked<% end %>>
<label class="form-check-label"
for="checkbox-<%= about.id %>">
<%= Communication::Extranet::Connection.human_attribute_name 'connected' %>
</label>