Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple form integration #1487

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Commits on Apr 8, 2024

  1. Configuration menu
    Copy the full SHA
    a1c670d View commit details
    Browse the repository at this point in the history
  2. Add #search_simple_form_for with custom builder

    Next:
    - Implement the builder
    abinoam committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    24a4717 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Add Ransack::Helpers::SimpleFormBuilder

    * It inherits from normal Ransack::Helpers::FormBuilder
    * It composes with an instance of SimpleForm:Builder,
      so it may delegate methods like SimpleForm "input"
    
    Next:
    - Extract "label_text"
    - Resolve simple_form dependency
    abinoam committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    c0c9721 View commit details
    Browse the repository at this point in the history
  2. Extracts #label_text to inject as SimpleForm label

    This allows SimpleForm to use the correct label like
      "name_cont" -> "Name contains"
    abinoam committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    b929d5b View commit details
    Browse the repository at this point in the history
  3. Add simple_form as development dependency

    It will not be "required" by default.
    So it doesn't increases gem's size.
    abinoam committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    c2ac845 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7be5edb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4bd3ed4 View commit details
    Browse the repository at this point in the history
  6. Add SimpleFormBuilder spec

    It checks if SimpleForm#input method is callable.
    And checks for correct wrapping of a normal text field.
    abinoam committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    ad9e367 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1886b10 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2024

  1. Add spec for 'type guessing' done by SimpleFormBuilder

    It should generate boolean fields whe the predicate is boolean.
      e.g.: _blank, _present, _true, _not_null
    
    It should respect the type of the ActiveRecord attribute otherwise.
      e.g.: Generate the proper date field for date attributes.
    abinoam committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    963337b View commit details
    Browse the repository at this point in the history
  2. Add methods for SimpleForm's attribute type inference

    Integrating with existing methods,
    even those not designated as 'public API',
    to minimize code duplication and maintain compatibility with future changes.
    abinoam committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    72e65f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    273e84e View commit details
    Browse the repository at this point in the history