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
  • !1097

Use new_resource in new action

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/EugeneGrigorenko/master into master Feb 15, 2018
  • Overview 10
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: EugeneGrigorenko

  • Simplify making new form with prefilled associations
  • Is supposed to close this issue https://github.com/thoughtbot/administrate/issues/220
  • Now to have simply override new_resource method instead of new action to init resource associations

P.S. Though, it works as expected on has_one association, when trying to build has_many association it doesn't work. The reason is that select is used on has_many form and only ids get send with the request. And because the record doesn't have an id it gets lost. I'm not sure if it's a bug and should be addressed or not, please let me know what you think.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/EugeneGrigorenko/master