ruby on rails - Why are all of my file field inputs disabled on iPad -


in rails 4 app have form 2 file field inputs upload s3:

<form accept-charset="utf-8" action="/projects" class="new_project" enctype="multipart/form-data" id="new_project" method="post">    <input id="project_videos_attributes_0_poster" name="project[videos_attributes][0][poster]" type="file">    ....    <input class="js-s3_file_field" data-acl="public-read" id="project_gifts_attributes_0_file" name="project[gifts_attributes][0][file]" type="file">  </form> 

the first file field uses carrierwave, , other hooked s3_file_field gem direct upload s3, both disabled when page viewed on ipad. no other platform/vendor has issue. it's seen when inputs presented in isolation too.

i'm wondering if turbolinks has ipad specific issues. rails ujs culprit? it's worth, here's code s3_file_field gem uses hijack second file input, can't see how possibly cause either file field disabled on platform:

ready = ->   $(".js-s3_file_field").each ->     id = $(this).attr('id')     $this = -> $("##{id}")     $progress = $(this).siblings('.progress').hide()     $meter = $progress.find('.meter')     $(this).s3filefield       add: (e, data) ->         $progress.show()         data.submit()       done: (e, data) ->         window.data = data.result         $progress.hide()         $this().attr(type: 'text', value: data.result.url, readonly: true)       fail: (e, data) ->         alert(data.failreason)       progress: (e, data) ->         progress = parseint(data.loaded / data.total * 100, 10)         $meter.css(width: "#{progress}%")  $(document).ready(ready) $(document).on('page:load', ready) 

it's strange. can't read html code on ipad either why hard troubleshoot. fine on linux, windows, mac, android. can't vouch iphone though.

ios5 not support file uploads!!!! not bug, it's "design feature" of ios5.

to fix, upgrade ios6, or download app lets file uploads!


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -