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
  • Issues
  • #1312
Closed
Open
Issue created Apr 11, 2019 by Administrator@rootContributor

I have a model called `Action`. How do I avoid the conflict with the `action` parameter?

Created by: mattgibson

My model called Action has a dashboard, but this error happens preventing it from loading:

undefined method `fetch' for "index":String

Which comes from this part of administrate/application_controller.rb around line 103:

    def order
      @order ||= Administrate::Order.new(
        params.fetch(resource_name, {}).fetch(:order, nil), # <-- error here
        params.fetch(resource_name, {}).fetch(:direction, nil),
      )
    end

The problem is that resource_name is action, which conflicts with the normal param called action which tells us that in this case, we want the index. We therefore get 'index' from the params, not nil which would give us the default empty object, which fetch would work on.

Is there a way around this?

Assignee
Assign to
Time tracking