Getting the image URL without the HTML in Rails

后端 未结 1 387
不知归路
不知归路 2021-01-04 02:51

In Rails is there a way to get the URL to the image (going through the assets_host) and just return the URL of the image? I want to use assets_host data in my Javascript, bu

1条回答
  •  有刺的猬
    2021-01-04 03:41

    image_path will return (you guessed it) the path to the image. It's the same method used in image_tag.

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