Rails 3.1: Determine if asset exists

后端 未结 4 807
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 00:42

Is there a built-in way to determine if an asset exists without resorting to File.exists?(File.join(Rails.root, \"foo\", \"bar\", \"baz\")) and that looks throu

4条回答
  •  误落风尘
    2020-12-24 01:24

    Please see the answer here for a discussion on why find_asset may not always work:

    Include Assets Only If They Exist

提交回复
热议问题