vendredi 27 octobre 2023

Error (Could not find the inverse association for profile_image_attachment (:record in ActiveStorage::Attachment)):

In my model/active_storage/attachment.rb file i had used this code

class ActiveStorage::Attachment < ApplicationRecord belongs_to :blob, class_name: "ActiveStorage::Blob" def self.ransackable_attributes(auth_object = nil) ["blob_id", "created_at", "id", "name", "record_id", "record_type"] end end "When creating Active Admin with Active Storage, I encountered a search error. To address this, I used defined the ransackable method in my model." in my model/user.rb i had used has_one_attached :profile_image when i open this link http://127.0.0.1:3000/users/1 it show this error unknown keywords: :class_name, :as, :inverse_of and when i open this link http://127.0.0.1:3000/admin it open successfullyenter image description here

i had used inverse of in my model/user.rb file , but it did't work i had go through all my schema file it generate activestorage of correctlly.

Aucun commentaire:

Enregistrer un commentaire