Ruby on rails 用于活动存储的Rails路由获取Blob
我的活动存储器上载成功,但当我在本地检索它时,会收到以下错误消息 本地活动存储blob检索的正确路由是什么Ruby on rails 用于活动存储的Rails路由获取Blob,ruby-on-rails,devise,rails-activestorage,Ruby On Rails,Devise,Rails Activestorage,我的活动存储器上载成功,但当我在本地检索它时,会收到以下错误消息 本地活动存储blob检索的正确路由是什么 错误 Could not find devise mapping for path "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBLdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0e11bfcbbc94f3699c9f559ee5f293a09c43bc
错误
Could not find devise mapping for path "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBLdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--0e11bfcbbc94f3699c9f559ee5f293a09c43bcac/1200px-Goldman_Sachs.svg.png". This may happen for two reasons: 1) You forgot to wrap your route inside the scope block. For example: devise_scope :user do get "/some/route" => "some_devise_controller" end 2) You are testing a Devise controller bypassing the router. If so, you can explicitly tell Devise which mapping to use: @request.env["devise.mapping"] = Devise.mappings[:user]
我尝试添加这些(但不起作用):
你如何进入附件?你的路线如何?
get '/rails/active_storage/blobs/:id', to: 'active_storage/disk_controller#show'
get '/rails/active_storage/disk/:id', to: 'active_storage/disk_controller#show'