grounds/grounds.io

View on GitHub
app/views/grounds/_option_dropdown.html.erb

Summary

Maintainability
Test Coverage
<% id = "#{option}-options" %>

<a href="#" data-dropdown="<%= id %>" class="dropdown">

  <%= t("editor.select.#{option}") %>

  <b id="<%= option %>-name" ><%= @ground.selected_label(option) %></b>

</a>

<ul id=<%= id %> data-dropdown-content class="dropdown-list">

  <% @ground.options(option).each do |code, label| %>

    <li>

    <%= link_to(label,
                ground_switch_option_path(option: "#{option}", code: code),
                data: { "#{option}" => code },
                class: "#{option}-selection",
                method: :put,
                remote: true) %>

    </li>

  <% end %>

</ul>