我正在使用ruby 3.1.3,rails 7.0.5和activeadmin 3.0.
我只是按照activeadmin 网站的安装说明进行操作,但出现以下错误:
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
): …Run Code Online (Sandbox Code Playgroud)