You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Feature
There's a common practice to have a
User
model that has ahas_one
association withProfile
.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
accepts_nested_attributes_for
because we could offload a lot of functionality on itfill_field
method before it's passed to the model as a nested attributeon the
Edit` viewbelongs_to
association on that formCurrent workarounds
Using resource tools, but it's a bit cumbersome.
The text was updated successfully, but these errors were encountered: