How can I get url of my has_one model attachment stored in active storage in my rails controller. So, that I would be able to send it as full link as api in json. So far, I have tried following methods but each of them are giving various issues:
current_user.image.service_url
---- undefined method `service_url' for #<ActiveStorage::Attached::One:0x....Rails.application.routes.url_helpers.rails_disk_blob_path(current_user.image, only_path: true)
, it gives me an output like:"/rails/blobs/%23%3CActiveStorage::Attached::One:0x007f991c7b41b8%3E"
but this is not a url, right? I am not able to hit and get image on browser.
url_for
----undefined method `active_storage_attachment_url' for #<Api::V1::UsersController:0x007f991c1eaa98