ruby on rails - CarrierWave/Cloudinary cached images not working across form redisplays in dev environment -
when form has error cached image isn't displayed. trying go cloudinary servers , download image doesn't exist.
here source ends as:
<div class="form-group"> <label class="col-sm-3 control-label" for="guide_image">image</label> <div class="col-sm-9"> <img alt="ho97jzyhfjludw129u8m" src="http://res.cloudinary.com/memorycommit/image/upload/ho97jzyhfjludw129u8m.jpg" /> <input class="form-control" id="guide_image" name="guide[image]" type="file" /> <input id="guide_image_cache" name="guide[image_cache]" type="hidden" value="1402249607-3970-6368/mountain-top-med.jpg" /> </div> </div>
here view code image:
<div class="form-group"> <%= f.label :image, class: "col-sm-3 control-label" %> <div class="col-sm-9"> <%= image_tag(@guide.image_url) if @guide.image? %> <%= f.file_field :image, class: "form-control" %> <%= f.hidden_field(:image_cache) %> </div> </div>
image_uploader.rb
class imageuploader < carrierwave::uploader::base include cloudinary::carrierwave version :standard process :resize_to_fill => [220, 220, :north] end version :thumbnail resize_to_fit(120, 120) end end
what doing wrong?
unfortunately, cl_image_tag
method doesn't support returning local url (such image image_cache
).
Comments
Post a Comment