Created
August 29, 2017 14:15
-
-
Save gregblake/245f376f67a1b5232b0e1784172d916c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= s3_uploader_form id: "s3-uploader" do %> | |
| <%= file_field_tag :file %> | |
| <% end %> | |
| # ... | |
| <%= javascript_include_tag "nitro_component_transition/documents/s3_uploader" %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form id="s3-uploader" data-callback-url="null" data-callback-method="POST" data-callback-param="file" enctype="multipart/form-data" action="https://s3-direct.powerhrg.com/nitro-devbox/" accept-charset="UTF-8" method="post"> | |
| <input name="utf8" type="hidden" value="✓" /> | |
| <input type="hidden" name="key" id="key" value="uploads/{timestamp}-{unique_id}-2ed77cb543200c5e1df1420aa797faa6/${filename}" /> | |
| <input type="hidden" name="acl" id="acl" value="public-read" /> | |
| <input type="hidden" name="AWSAccessKeyId" id="AWSAccessKeyId" value="GWNQSVNDSVYEMTU6EFPD" /> | |
| <input type="hidden" name="policy" id="policy" value="eyJleHBpcmF0aW9uIjoiMjAxNy0wOC0zMFQwMDoxMzo1NFoiLCJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiR1dGY4IiwiIl0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJ1cGxvYWRzLyJdLFsic3RhcnRzLXdpdGgiLCIkeC1yZXF1ZXN0ZWQtd2l0aCIsIiJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsNTI0Mjg4MDAwXSxbInN0YXJ0cy13aXRoIiwiJGNvbnRlbnQtdHlwZSIsIiJdLHsiYnVja2V0Ijoibml0cm8tZGV2Ym94In0seyJhY2wiOiJwdWJsaWMtcmVhZCJ9LHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjoiMjAxIn1dfQ==" /> | |
| <input type="hidden" name="signature" id="signature" value="ttQqJ4CLLcKEoL2V0MqFy9VcEEQ=" /> | |
| <input type="hidden" name="success_action_status" id="success_action_status" value="201" /> | |
| <input type="hidden" name="X-Requested-With" id="X-Requested-With" value="xhr" /> | |
| <input type="file" name="file" id="file" /> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).on('page:update', function(){ | |
| $('#s3-uploader').fileupload(); | |
| $('#s3-uploader').fileupload('option', { | |
| type: 'put', | |
| } | |
| ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment