<% if @error.present? %>

<%= @error.message %>

<% else %>
        

Create company

# app/lib/services/hubspot/companies/create.rb

Export to CSV

# app/lib/services/hubspot/companies/export.rb

<%= link_to('New Company', new_company_path, class: 'button', id: 'new-company') %> <%= link_to('Export To CSV', export_companies_path(format: :csv), class: 'button', id: 'export') %>
<%= form_tag('/companies', method: :get, class: 'companies') do %> <%= text_field_tag(:search, @search_q, placeholder: 'Search by email..', id: 'search') %> <% end %> <% if flash[:notice] %>
<%= flash[:notice] %>
<% end %> <% @companies.each do |company| %> <% end %>
ID Name Domain
<%= company.id %>
<%= company.properties['name'] %>
<%= company.properties['domain'] %>
<%= button_to "delete", { controller: :companies, action: :destroy, id: company.id }, method: :delete, form_class: 'delete-button' %>
<% end %>
    

Delete

# app/lib/services/hubspot/companies/destroy.rb