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

Add form_with to unify form_tag/form_for. #26976

Merged
merged 16 commits into from
Nov 21, 2016
Merged

Commits on Nov 6, 2016

  1. Add form_with to unify form_tag/form_for.

    `form_tag` and `form_for` serve very similar use cases. This
    PR unifies that usage such that `form_with` can output just
    the opening form tag akin to `form_tag` and can just work with
    a url, for instance.
    
    `form_with` by default doesn't attach class or id to the form —
    removing them on fields is moved out to a default revisiting PR later.
    
    Ported over old tests where applicable to ensure maximum coverage,
    but left some commented out because they don't yet apply (e.g.
    `fields_for` later being replaced by `fields`).
    
    [ Kasper Timm Hansen & Marek Kirejczyk ]
    kaspth committed Nov 6, 2016
    Configuration menu
    Copy the full SHA
    18a44be View commit details
    Browse the repository at this point in the history
  2. Code climatize.

    kaspth committed Nov 6, 2016
    Configuration menu
    Copy the full SHA
    c0df7c6 View commit details
    Browse the repository at this point in the history
  3. Add fields DSL method.

    Strips `_for` and requires models passed as a keyword argument.
    kaspth committed Nov 6, 2016
    Configuration menu
    Copy the full SHA
    1e7e5cb View commit details
    Browse the repository at this point in the history
  4. Document form_with.

    Graft the `form_for` docs: rewrite, revise and expand where
    needed.
    
    Also test that a `format` isn't used when an explicit URL
    is passed.
    kaspth committed Nov 6, 2016
    Configuration menu
    Copy the full SHA
    a4a5945 View commit details
    Browse the repository at this point in the history
  5. Enable remote by default.

    Brand new world! Forms submit via XHRs by default, woah.
    kaspth committed Nov 6, 2016
    Configuration menu
    Copy the full SHA
    31a9608 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2016

  1. Readd commented out tests.

    Gives us something to revise when we're redoing the
    form options helpers.
    
    Also deletes the needless tests for the unsupported namespace
    option.
    kaspth committed Nov 8, 2016
    Configuration menu
    Copy the full SHA
    3a55155 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2016

  1. [ci skip] Document the fields helpers.

    Treat both the FormBuilder and FormHelper.
    kaspth committed Nov 13, 2016
    Configuration menu
    Copy the full SHA
    b714aa8 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2016

  1. Configuration menu
    Copy the full SHA
    e3eb691 View commit details
    Browse the repository at this point in the history
  2. [ci skip] Documentation edits.

    kaspth committed Nov 14, 2016
    Configuration menu
    Copy the full SHA
    5a4052a View commit details
    Browse the repository at this point in the history
  3. Use ERB tags.

    kaspth committed Nov 14, 2016
    Configuration menu
    Copy the full SHA
    7d6fc1f View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2016

  1. Configuration menu
    Copy the full SHA
    694c226 View commit details
    Browse the repository at this point in the history
  2. Invert include_id to skip_id.

    `skip_id: true` reads better than `include_id: false` (since the
    `include_id` default is true).
    kaspth committed Nov 20, 2016
    Configuration menu
    Copy the full SHA
    407d9f2 View commit details
    Browse the repository at this point in the history
  3. Invert remote to local.

    Since forms are remote by default, the option name makes more sense
    as `local: true`.
    kaspth committed Nov 20, 2016
    Configuration menu
    Copy the full SHA
    42f4fb2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    15a805c View commit details
    Browse the repository at this point in the history
  5. Refer to the brand spanking new rails-ujs.

    Soon to be bundled in Rails proper, so jquery-ujs is out.
    kaspth committed Nov 20, 2016
    Configuration menu
    Copy the full SHA
    17429bb View commit details
    Browse the repository at this point in the history
  6. Make form_with a bit more composed.

    The flow is still not quite what it should be because the legacy
    methods and these new ones pull at opposite ends.
    
    Lots of options have been renamed, so now the new pieces don't fit
    in so well.
    
    I'll try to work on this in later commits after this PR (it's likely
    there's a much better way to structure this whole part of Action View).
    kaspth committed Nov 20, 2016
    Configuration menu
    Copy the full SHA
    30ebe5d View commit details
    Browse the repository at this point in the history