-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Commits on Nov 6, 2016
-
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 ]
Configuration menu - View commit details
-
Copy full SHA for 18a44be - Browse repository at this point
Copy the full SHA 18a44beView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0df7c6 - Browse repository at this point
Copy the full SHA c0df7c6View commit details -
Strips `_for` and requires models passed as a keyword argument.
Configuration menu - View commit details
-
Copy full SHA for 1e7e5cb - Browse repository at this point
Copy the full SHA 1e7e5cbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a4a5945 - Browse repository at this point
Copy the full SHA a4a5945View commit details -
Brand new world! Forms submit via XHRs by default, woah.
Configuration menu - View commit details
-
Copy full SHA for 31a9608 - Browse repository at this point
Copy the full SHA 31a9608View commit details
Commits on Nov 8, 2016
-
Gives us something to revise when we're redoing the form options helpers. Also deletes the needless tests for the unsupported namespace option.
Configuration menu - View commit details
-
Copy full SHA for 3a55155 - Browse repository at this point
Copy the full SHA 3a55155View commit details
Commits on Nov 13, 2016
-
[ci skip] Document the fields helpers.
Treat both the FormBuilder and FormHelper.
Configuration menu - View commit details
-
Copy full SHA for b714aa8 - Browse repository at this point
Copy the full SHA b714aa8View commit details
Commits on Nov 14, 2016
-
Configuration menu - View commit details
-
Copy full SHA for e3eb691 - Browse repository at this point
Copy the full SHA e3eb691View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a4052a - Browse repository at this point
Copy the full SHA 5a4052aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d6fc1f - Browse repository at this point
Copy the full SHA 7d6fc1fView commit details
Commits on Nov 20, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 694c226 - Browse repository at this point
Copy the full SHA 694c226View commit details -
`skip_id: true` reads better than `include_id: false` (since the `include_id` default is true).
Configuration menu - View commit details
-
Copy full SHA for 407d9f2 - Browse repository at this point
Copy the full SHA 407d9f2View commit details -
Since forms are remote by default, the option name makes more sense as `local: true`.
Configuration menu - View commit details
-
Copy full SHA for 42f4fb2 - Browse repository at this point
Copy the full SHA 42f4fb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15a805c - Browse repository at this point
Copy the full SHA 15a805cView commit details -
Refer to the brand spanking new rails-ujs.
Soon to be bundled in Rails proper, so jquery-ujs is out.
Configuration menu - View commit details
-
Copy full SHA for 17429bb - Browse repository at this point
Copy the full SHA 17429bbView commit details -
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).
Configuration menu - View commit details
-
Copy full SHA for 30ebe5d - Browse repository at this point
Copy the full SHA 30ebe5dView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.