ikuseiGmbH/smart-village-app-cms

View on GitHub
app/views/shared/partials/_contact_form.html.erb

Summary

Maintainability
Test Coverage
<div class="row">
  <div class="col-lg-6">
    <div class="form-group">
      <label for="description">Vorname</label>
      <%= form.text_field :first_name, class: "form-control" %>
    </div>
  </div>

  <div class="col-lg-6">
    <div class="form-group">
      <label for="description">Nachname</label>
      <%= form.text_field :last_name, class: "form-control" %>
    </div>
  </div>
</div>

<div class="row">
  <div class="col">
    <div class="form-group">
      <label for="description">E-Mail</label>
      <%= form.text_field :email, class: "form-control" %>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-lg-6">
    <div class="form-group">
      <label for="description">Telefon</label>
      <%= form.text_field :phone, class: "form-control" %>
    </div>
  </div>

  <div class="col-lg-6">
    <div class="form-group">
      <label for="description">Fax</label>
      <%= form.text_field :fax, class: "form-control" %>
    </div>
  </div>
</div>

<% list_of_web_urls = contact.web_urls.presence || [OpenStruct.new] %>
<% list_of_web_urls.each do |web_url| %>
  <%= form.fields_for :web_urls, web_url do |fu| %>
    <div class="row">
      <div class="col-lg-6">
        <div class="form-group">
          <label for="description">URL</label>
          <%= fu.text_field :url, class: "form-control" %>
        </div>
      </div>

      <div class="col-lg-6">
        <div class="form-group">
          <label for="description">Linktext (wird ggf. statt der URL angezeigt)</label>
          <%= fu.text_field :description, class: "form-control" %>
        </div>
      </div>
    </div>
  <% end %>
<% end %>