Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 24, 2025

  • Analyze existing search_form_for implementation and test structure
  • Add search_form_with method to FormHelper module that mirrors search_form_for but uses form_with instead of form_for
  • Ensure search_form_with handles all the same parameters and options as search_form_for
  • Add comprehensive tests for search_form_with covering all existing search_form_for test scenarios
  • Ensure backward compatibility by retaining all existing helpers
  • Verify that form builder integration works correctly with search_form_with
  • Test search_form_with with different formats (default, pdf, json)
  • Test search_form_with with array routing
  • Test search_form_with with custom search keys
  • Validate that all existing tests still pass

Additional instructions:

provide form helper updates for form_with but retain the old helpers also. Ensure full tests

Fixes #962


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@scarroll32 scarroll32 marked this pull request as ready for review September 24, 2025 21:15
@scarroll32 scarroll32 changed the title [WIP] Add the helper search_form_with Add the helper search_form_with Sep 24, 2025
@scarroll32 scarroll32 requested review from Copilot and removed request for scarroll32 September 24, 2025 21:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new search_form_with helper method to the FormHelper module that provides the same functionality as search_form_for but uses the modern form_with instead of the legacy form_for. This addresses issue #962 by providing a contemporary alternative while maintaining backward compatibility.

  • Added search_form_with method that mirrors search_form_for functionality
  • Added comprehensive test coverage for all scenarios including format handling, array routing, and custom search keys
  • Maintained backward compatibility by keeping existing helpers intact

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/ransack/helpers/form_helper.rb Implements the new search_form_with method and supporting finalize_form_with_options helper
spec/ransack/helpers/form_helper_spec.rb Adds comprehensive test suite covering all search_form_with scenarios and edge cases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@scarroll32 scarroll32 enabled auto-merge (squash) September 24, 2025 21:17
@scarroll32 scarroll32 merged commit af55622 into main Sep 24, 2025
25 checks passed
@scarroll32 scarroll32 deleted the copilot/fix-f8b46e71-f425-4f4a-8480-1efbad2ed495 branch September 24, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the helper search_form_with
2 participants