Call image upload with CarriereWave Ruby gem in angular
Not solved Solved
3 months ago

Hello. I'm on a project that I did not create. It is in Rails and Angular1. The carrierwave gem is used to upload images, four declinations are created, the original image, Thumb, Big Thumb and Square. The problem is that the image that is displayed is the product.texture Square version I would like the original version which should be product.textureUrl but it does not work (It is called like this in another file). The controller does not change the size of the image, it just update "imgsrc"

The image is called like this

img class="picture-main" ng-src="{{ imgsrc }}"

And is selected from a list in the same file

ui-select ng-model="hc.customization.product" theme="bootstrap" on-select="update($select.selected.textureUrlThumb)"
        ui-select-match placeholder="Séléctionner un produit" on-select="imgsrc=$item"
          | {{ $select.selected.title }}
        ui-select-choices repeat="product in hc.products"
            img class="ui-select-image" ng-src="{{ product.textureUrlThumb }}" ng-mouseover="update(product.textureUrlThumb)" ng-mouseout="update(harmony.pictureUrlSquare)"
            span  ng-mouseover="update(product.textureUrlThumb)" ng-mouseout="update(harmony.pictureUrlSquare)"
              | {{ product.title }}

It is on-select="update($select.selected.textureUrlThumb)" who changes the picture
harmony.pictureUrlSquare is the image that is displayed when no product is selected

I hope that is understandable
Thank you for your answers

Submit your answer