dimanche 16 juillet 2023

active admin gem error message just following the instructions

I am using ruby 3.1.3, rails 7.0.5 and activeadmin 3.0.

I just followed the installation instructions from the activeadmin website, but I got the following error:

ActionView::Template::Error (Ransack needs AdminUser attributes explicitly allowlisted as
searchable. Define a `ransackable_attributes` class method in your `AdminUser`
model, watching out for items you DON'T want searchable (for
example, `encrypted_password`, `password_reset_token`, `owner` or
other sensitive information). You can use the following as a base:

ruby
class AdminUser < ApplicationRecord

  # ...

  def self.ransackable_attributes(auth_object = nil)
    ["created_at", "email", "encrypted_password", "id", "remember_created_at", "reset_password_sent_at", "reset_password_token", "updated_at"]
  end

  # ...

end

):
    1: # frozen_string_literal: true
    2: insert_tag renderer_for(:index)

I tried to follow the instructions but I got the same error but now the array inside of the function is empty.

Aucun commentaire:

Enregistrer un commentaire