I am working on a Rails application with the Angular-driver interface. I want to include images from my Rails resource folders in a view that is shown only in certain contexts using the directive ng-switch. I tried a couple of solutions, for example, by entering the file path of all the other (Rails-served) images in the tag srctag <img>. I also tried adding the erb suffix to the coffeescript file containing the angular controller, and then doing the following:
$scope.logoSrc = '<%= asset_path("images/logo_grey.png") %>'
and using the directive ng-srcin the image tag, but that gave 404.
I will gladly post more of my code if this is helpful. Thanks in advance for your help!
source
share