Rails: Missing host to link to! Please provide :host parameter or set default_url_options[:host]

前端 未结 15 2660
深忆病人
深忆病人 2020-11-27 10:34

I have been googling for about 90 minutes now and still don\'t have an answer to this. Where do I set default_url_options? I\'ve already set it for conf

15条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 11:33

    just in case someone finds this searching for errors concerning ActiveStorage:

    if you have a controller-action where you want to generate upload-urls etc with the local disc-service (most likely in test environment), you need to include ActiveStorage::SetCurrent in the controller in order to allow blob.service_url_for_direct_upload to work correctly.

提交回复
热议问题