vendredi 20 septembre 2019

to_model delegated to attachment, but attachment is nil

So I asked this question already here: previous question and didn't get much help, I looked for other questions similar to mine, but no resolution. So I'll ask the question again in hopes of getting help. The issue is that the image that is uploaded for a user profile banner isnt showing on the user show page aka profile page. I'm using active storage. I already have the

has_on_attached :banner_image

.profile-header
  = image_tag url_for(@user.banner_image)

def set_user
  @user = User.find(params[:id])
end

devise registration config:

def configure_account_update_params
  before_action :configure_account_update_params, only: [:update]
  devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname, :banner_image])
end

error msg image

Aucun commentaire:

Enregistrer un commentaire