Batmanjs image upload

124 Views Asked by At

I'm using BatmanJs and Rails. I used carrierwave for uploading pictures and all worked fine. But, I am unable to show the image. The model has the attr photo.url which works fine. But I don't know how to bind a image tag.

I tried the following, with no result:

<img data-src="post.photo.url" />
<img data-bind="post.photo.url" />

But if I use

<span data-src="post.photo.url"></span>

it shows the url perfectly.

Kindly suggest how do i get it to work for img tag.

1

There are 1 best solutions below

0
rmosolgo On

Very close! try data-bind-src. Actually, you can use data-bind-#{anything} to bind html attributes to keypaths.