JordanHatch/maslow-redux

View on GitHub
app/views/needs/_duplicate_of_need.html.erb

Summary

Maintainability
Test Coverage
<%= semantic_form_for need, { url: closed_need_path(need) } do |f| %>
    <%= f.input :canonical_need_id,
                as: :select,
                label: 'This need is a duplicate of',
                collection: NeedCollectionPresenter.new(
                    Need.where.not(id: need.id)
                  ).as_collection,
                input_html: {
                  'data-module' => 'chosen',
                }
              %>
    <%= f.action :submit,
                 :button_html => {
                   :value => "Close as a duplicate",
                   :class => "btn btn-danger"
                 }
               %>
<% end %>