activeadmin: permit_params broken since 8872d84ea90

permit_params are broken since commit 8872d84ea90 (fix permit_params for renamed resources)

Prior to this commit the form for an engine model “Inventory::Computer” has been posted as

Parameters: "hostname"=>"", "computer_type_id"=>"" [..and so on..]

after this commit it changed to:

Parameters: "inventory_computer"=>{"hostname"=>"", "computer_type_id"=>"" [..and so on..]}

The form cannot be successfully submitted as the error Unpermitted parameters: utf8, authenticity_token, inventory_computer, commit occurs and any validators like “presence: true” aren’t valid anymore.

Can anyone confirm this or is this an intended change?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

You can get around this error by doing:

ActiveAdmin.register Inventory::Computer do
  permit_params :name

  controller do
    resources_configuration[:self][:instance_name] = 'computer'
  end
end