Replace the structured search filter approach with from_text(), enabling the full search syntax (is:nc, occupies:background, user:owns, etc.) in a single text field. Changes: - Search form now uses single `q` text param instead of `q[name]` - Controller uses Item::Search::Query.from_text instead of from_params - Auto-fit filter applied via .merge(Item.fits(body_id)) in controller - Added error handling for Item::Search::Error - Updated pagination param from `q[page]` to `page` - Removed build_search_filters method (no longer needed) - Fixed outfit_state_params helper to handle q as string Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 lines
685 B
Text
17 lines
685 B
Text
.search-results
|
|
- if @search_error
|
|
.error-state
|
|
%p.error-message= @search_error
|
|
- elsif @search_results.any?
|
|
= will_paginate @search_results, page_links: false, param_name: :page, params: @outfit.wardrobe_params.merge(q: params[:q])
|
|
|
|
%ul.search-results-list
|
|
- @search_results.each do |item|
|
|
- appearance = @appearances_by_item_id&.dig(item.id)
|
|
= render "items/item_card", item: item, appearance: appearance
|
|
|
|
= will_paginate @search_results, param_name: :page, params: @outfit.wardrobe_params.merge(q: params[:q])
|
|
|
|
- else
|
|
.empty-state
|
|
%p No matching items found. Try a different search term, or browse items on the main site.
|