Skip to content

param is not working with belongs_to #700

@samstickland

Description

@samstickland

I have this configuration in my activeadmin file:

  ActiveAdmin.register Assignments::Model::Rate, as: 'Rate' do
    belongs_to :assignment, param: :reference_number, parent_class: Assignments::Model::Assignment

But I'm not seeing the route get generated with the right param name:

be rails routes | grep edit_admin_assignment_rate

edit_admin_assignment_rate GET      /admin/assignments/:assignment_id/rates/:id/edit(.:format)                                        admin/rates#edit

I'm expecting assignment_id to be reference_number

I've dug into the source code a bit and I can't see how the param config is supposed to be used:

It looks to like that config is only ever retrieved here, and only used inside of this block, where param isn't accessed:

config = self.resources_configuration[symbol]

ActiveAdmin: 2.9.0
InheritedResources: 1.13.0
Ruby: 3.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions