Rails 3.1 absolute URL to an image

前端 未结 7 841
孤街浪徒
孤街浪徒 2020-12-08 14:27

I\'m using Rails 3.1. I\'m trying to figure this out, and to my surprise, it is starting to seem that rails does not come with this method at all. Maybe im wrong.

Ca

相关标签:
7条回答
  • 2020-12-08 14:55

    Could you just do:

    root_url[0..-2] + asset_path(image.png)
    

    ...to trim the trailing slash in the root url?

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