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 option to skip adding model scope to form inputs #1704

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

camertron
Copy link
Contributor

@camertron camertron commented Dec 13, 2022

Description

By default, Rails will wrap form field names and IDs with the model name. For example, a form for a User model with a first_name field would include a text input with a name of user[first_name] and an ID of user_first_name. Sometimes doing so is not desirable. This PR introduces two options, scope_name_to_model and scope_id_to_model that, when set to false, will not wrap field names and/or IDs.

Integration

Does this change require any updates to code in production?

No

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews

@changeset-bot
Copy link

changeset-bot bot commented Dec 13, 2022

🦋 Changeset detected

Latest commit: ebe36af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@camertron camertron temporarily deployed to review-pr-1704 December 13, 2022 00:14 — with GitHub Actions Inactive
@camertron camertron temporarily deployed to github-pages December 13, 2022 00:20 — with GitHub Actions Inactive
@camertron camertron merged commit f54ee3f into main Dec 13, 2022
@camertron camertron deleted the remove_model_scope_from_name branch December 13, 2022 19:17
@primer-css primer-css mentioned this pull request Dec 13, 2022
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.

2 participants