gitcoinco/code_fund_ads

View on GitHub
app/views/organization_users/forms/_new_user_form.html.erb

Summary

Maintainability
Test Coverage
<%= simple_form_for(:organization_invite, method: :post, url: organization_invites_path) do |f| %>
  <%= render(Card::BodyComponent.new) do %>
    <div class="row">
      <%= tag.div f.input(:first_name, required: true), class: "col-12 col-md-6" %>
      <%= tag.div f.input(:last_name, required: true), class: "col-12 col-md-6" %>
      <%= tag.div f.input(:email, required: true), class: "col-12 col-md-6" %>
      <%= tag.div f.input(:organization_role, label: "Role", required: true,
          collection: ENUMS::ORGANIZATION_ROLES.values.map { |role| [role.capitalize, role] },
          input_html: {class: "form-control", data: {controller: "select"}}), class: "col-12 col-md-6" %>
      <%= f.hidden_field :organization_id, value: organization.id %>
    </div>
  <% end %>
  <%= render Card::FooterComponent.new do |component| %>
    <% component.with(:actions) do %>
      <%= cancel_button(organization_users_path(organization)) %>
      <%= f.submit "Send Invitation", class: "btn btn-primary" %>
    <% end %>
  <% end %>
<% end %>