Skip to content

Edit has_one field in forms #2664

Open
Open
@adrianthedev

Description

@adrianthedev

Feature

There's a common practice to have a User model that has a has_one association with Profile.
Also, there's a common need to be able to edit the profile record on the edit user page.

So we'd like to support that.

Approach

  • we could use accepts_nested_attributes_for because we could offload a lot of functionality on it
  • we need to make sure that the nested fields have their values passed through their own fill_field method before it's passed to the model as a nested attribute
  • we need to render the form for the has_oneon theEdit` view
  • we need to hide the inverse belongs_to association on that form
  • do we need to have a mechanism to hide/sow fields if the resource is nested?

Current workarounds

Using resource tools, but it's a bit cumbersome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DSL-relatedEnhancementNot necessarily a feature, but something has improvedTaskSomething to get done

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions