Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !1259

Use Show Page Attributes When Rendering a has_one Relationship On Another Record's Show Page

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/conradbeach/nested_show_for_has_one into master Dec 11, 2018
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 4

Created by: conradbeach

When rendering a has_one relationship on the show page for a record, we're presently displaying the form attributes of the child record (as defined in the FORM_ATTRIBUTES constant from the child record's dashboard file).

I think it makes more sense to use the child record's show page attributes (as defined in the SHOW_PAGE_ATTRIBUTES constant from the child record's dashboard file). That just fits better when rendering a record on a show page.

Furthermore, using the form attributes can lead to displaying odd attributes such as "Password Confirmation".

This pull request makes the necessary changes to use the show page attributes of the child record instead of the form attributes.

It also makes use of the render_field helper to render each field a little more nicely than the raw data rendering we're doing right now.

Current snip20181207_5_edited

Changed by This Pull Request snip20181207_8

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/conradbeach/nested_show_for_has_one