Rails 3.1 make folder to be public

前端 未结 2 1777
独厮守ぢ
独厮守ぢ 2021-01-17 04:54

Hello I\'m new to rails.

In my RoR app folder I have a folder (app/FOLDER) that I want to make public (there are script files that need to avaliable fro

2条回答
  •  感动是毒
    2021-01-17 05:38

    In the latest Rails the files should exist in one of the following...

    app/assets
    lib/assets
    vendor/assets
    

    If you cannot move the folder but still need it to be accessible you can use...

    Rails.application.config.assets.paths << folder_path
    

    Slightly more detailed answer over here...

    Rails 3.1: The public directory no longer serves js assets. How to load an additional js file after page is loaded?

提交回复
热议问题