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

Nested collection links should honour routes

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/karlentwistle/bug/make_nested_collection_links_honour_routes into master May 10, 2017
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 4

Created by: karlentwistle

Prior to this commit if any routes where omitted for a resource like:

resources :users
resources :orders, except: [:edit, :update]

Navigating directly to a orders show page would correctly omit the edit link but if another associated dashboard utilised a field that rendered using the partial _collection.html.erb like:

class UserDashboard < Administrate::BaseDashboard
  ATTRIBUTE_TYPES = {
    orders: Field::HasMany,
  }

  SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys
end

when navigating to the users show page an error 500 would be thrown because the rendering of orders would incorrectly try to link to the non existent edit route

Fixes #790 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/karlentwistle/bug/make_nested_collection_links_honour_routes