0
如何在視圖中使用ActionController :: Base.helpers.asset_url訪問資產管道?我正在使用Rails 4.我需要訪問app/assets/images中的圖像。Rails 4 ActionController :: Base.helpers.asset_url
如何在視圖中使用ActionController :: Base.helpers.asset_url訪問資產管道?我正在使用Rails 4.我需要訪問app/assets/images中的圖像。Rails 4 ActionController :: Base.helpers.asset_url
要做到這一點,您需要確保您的配置在您的development.rb文件中正確。
-config.action_controller.asset_host = 'http://yourwebsite.dev'
要訪問它從您的意見使用此代碼。