Access Asset Path from Rails Controller

后端 未结 1 1616
北荒
北荒 2020-12-01 02:04

I\'m sharing a configuration yml file client side, that I need to also load on the server side, I\'ve placed it inside app/assets/javascripts/configuration.yml

I can

1条回答
  •  醉酒成梦
    2020-12-01 02:18

    ActionController::Base.helpers.asset_path("configuration.yml")
    

    Might also be good to put configuration.yml in a different folder to separate javascript from non-javascript files.

    0 讨论(0)
提交回复
热议问题