Open sarii0213 opened 1 year ago
to_let_go_items/index.html.erb
<div class="text-center mb-4">
<%= form_with url: to_let_go_items_path, method: :get do |f| %>
<div class="d-flex mx-3 mb-3 justify-content-center flex-wrap">
<%= f.collection_select :category_id, Category.selectable, :id, :name,
{ prompt: 'カテゴリー' },
{ class: 'badge color-white bg-teal-dark me-3' } %>
<%= f.collection_select :reason_id, Reason.selectable, :id, :name,
{ prompt: '手放す理由' },
{ class: 'badge color-white bg-blue-light' } %>
</div>
<div class="d-flex mx-3 justify-content-center flex-wrap">
<%= button_tag type: 'submit', class: 'px-3 py-1 me-3 btn btn-border rounded-xs border-brown-dark color-brown-dark font-13 d-flex align-items-center' do %>
<i class="fas fa-search font-11 me-1"></i> 絞り込む
<% end %>
<%#= f.submit '絞り込む', name: nil, class: 'px-3 py-1 me-3 btn btn-border rounded-xs border-brown-dark color-brown-dark' %>
<%= link_to '全て表示', to_let_go_items_path, class: 'border-bottom text-reset' %>
</div>
<% end %>
</div>
done_letting_go_items/index.html.erb
<div class="text-center mb-4">
<%= form_with url: done_letting_go_items_path, method: :get do |f| %>
<div class="d-flex mx-3 mb-3 justify-content-center flex-wrap">
<%= f.collection_select :category_id, Category.selectable, :id, :name,
{ prompt: 'カテゴリー' },
{ class: 'badge color-white bg-teal-dark me-3' } %>
<%= f.collection_select :reason_id, Reason.selectable, :id, :name,
{ prompt: '手放す理由' },
{ class: 'badge color-white bg-blue-light' } %>
<%= f.collection_select :letting_go_way_id, LettingGoWay.selectable, :id, :name,
{ prompt: '手放す方法' },
{ class: 'badge color-white bg-highlight-dark mt-2' } %>
</div>
<div class="d-flex mx-3 justify-content-center flex-wrap">
<%= button_tag type: 'submit', class: 'px-3 py-1 me-3 btn btn-border rounded-xs border-brown-dark color-brown-dark font-13 d-flex align-items-center' do %>
<i class="fas fa-search font-11 me-1"></i> 絞り込む
<% end %>
<%#= f.submit '絞り込む', name: nil, class: 'px-3 py-1 me-3 btn btn-border rounded-xs border-brown-dark color-brown-dark' %>
<%= link_to '全て表示', to_let_go_items_path, class: 'border-bottom text-reset' %>
</div>
<% end %>
</div>
<!--<div class="text-center mb-3">-->
<!-- <span class="badge color-white bg-teal-dark me-3">カテゴリー<i class="fas fa-chevron-down font-8 ms-2"></i></span>-->
<!-- <span class="badge color-white bg-blue-light me-3">手放す理由<i class="fas fa-chevron-down font-8 ms-2"></i></span>-->
<!-- <span class="badge color-white bg-highlight-dark">手放す方法<i class="fas fa-chevron-down font-8 ms-2"></i></span>-->
<!--</div>-->
参考 https://qiita.com/kcl215/items/c0222befe4a6b270986a
日時のソートいる?
うまくいかないので一旦非表示に