{"id":14955604,"url":"https://github.com/blocknotes/activeadmin_jfu_upload","last_synced_at":"2025-10-01T18:31:46.679Z","repository":{"id":48616056,"uuid":"122720969","full_name":"blocknotes/activeadmin_jfu_upload","owner":"blocknotes","description":"An ActiveAdmin plugin to use jQuery-File-Upload for file uploads in forms","archived":false,"fork":false,"pushed_at":"2022-03-18T18:03:56.000Z","size":102,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T11:21:40.035Z","etag":null,"topics":["activeadmin","activeadmin-plugin","jquery","rails5","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blocknotes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["blocknotes"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2018-02-24T08:38:51.000Z","updated_at":"2023-08-15T09:12:35.000Z","dependencies_parsed_at":"2022-09-11T14:21:29.661Z","dependency_job_id":null,"html_url":"https://github.com/blocknotes/activeadmin_jfu_upload","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_jfu_upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_jfu_upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_jfu_upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocknotes%2Factiveadmin_jfu_upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocknotes","download_url":"https://codeload.github.com/blocknotes/activeadmin_jfu_upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234725299,"owners_count":18877350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activeadmin","activeadmin-plugin","jquery","rails5","ruby"],"created_at":"2024-09-24T13:11:26.250Z","updated_at":"2025-10-01T18:31:46.247Z","avatar_url":"https://github.com/blocknotes.png","language":"Ruby","readme":"# ActiveAdmin jQuery File Upload\n[![gem Version](https://badge.fury.io/rb/activeadmin_jfu_upload.svg)](https://badge.fury.io/rb/activeadmin_jfu_upload) [![gem downloads](https://badgen.net/rubygems/dt/activeadmin_jfu_upload)](https://rubygems.org/gems/activeadmin_jfu_upload) [![linters](https://github.com/blocknotes/activeadmin_jfu_upload/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_jfu_upload/actions/workflows/linters.yml) [![specs](https://github.com/blocknotes/activeadmin_jfu_upload/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/activeadmin_jfu_upload/actions/workflows/specs.yml)\n\nAn ActiveAdmin 2.x plugin to use [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload) for file uploads in forms.\n\nFeatures:\n- AJAX uploads;\n- chunked file uploads for large files;\n- works with ActiveStorage.\n\nThe file is uploaded when selected, not when the form is submitted, that's why a record must exist for uploads.\n\n## Install\n\n- Update your Gemfile: `gem 'activeadmin_jfu_upload'` (and execute *bundle*)\n- Add at the end of your ActiveAdmin styles (_app/assets/stylesheets/active_admin.scss_):\n```css\n@import 'activeadmin/jfu_upload_input';\n```\n- Add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_):\n```js\n//= require activeadmin/jfu_upload/jquery.fileupload\n//= require activeadmin/jfu_upload_input\n```\n- Use the input with `as: :jfu_upload` in Active Admin model conf\n\nWhy 2 separated scripts? In this way you can include a different version of *jQuery-File-Upload* if you like.\n\n## Options\n\n**data-options**: permits to set *jQuery-File-Upload* options directly - see [options list](https://github.com/blueimp/jQuery-File-Upload/wiki/Options)\n\n## Examples\n\n```ruby\n# ActiveAdmin article form conf:\n  # (optional) Upload action - an helper method is provided\n  member_action :jfu_upload, method: [:patch] do\n    render json: ActiveAdmin::JfuUpload::Engine::upload_file( request, params[:article][:cover], resource, :cover )\n  end\n\n  # Form setup\n  form do |f|\n    f.inputs 'Article' do\n      f.input :title\n      # Field setup - hint with file presence check using ActiveStorage\n      f.input :cover, as: :jfu_upload, hint: (object.avatar.attached? ? \"Current: #{object.avatar.filename}\" : nil) unless object.new_record?\n      f.input :published\n    end\n    f.actions\n  end\n\n  # Show setup (optional)\n  show do\n    attributes_table do\n      # ...\n      row :cover do |record|\n        image_tag url_for(record.cover) if record.cover.attached?\n      end\n    end\n    active_admin_comments\n  end\n```\n\n```ruby\n# Chuncked upload (chunk size: 100 Kb) - checking presence with CarrierWave\nf.input :cover, as: :jfu_upload, hint: f.object.cover? ? image_tag( f.object.cover.url ) : '', input_html: { data: { url: jfu_upload_admin_article_path( resource.id ), options: { maxChunkSize: 100000 } } } unless f.object.new_record?\n```\n\nMore example in [spec dummy app](spec/dummy/app/admin).\n\n## Notes\n\n- The string field for the upload is used to store temp data, so it could be necessary to make it bigger\n- If you want to customize the upload action take a look [here](lib/activeadmin/jfu_upload/engine.rb)\n- Tested with CarrierWave uploader gem and with ActiveStorage\n- To use this plugins with ActiveAdmin 1.x please use the version 0.1.8\n\n## Do you like it? Star it!\n\nIf you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓\u0026tab=repositories\u0026q=activeadmin\u0026type=source).\n\nOr consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).\n\n## Contributors\n\n- [Mattia Roccoberton](http://blocknot.es) - creator, maintainer\n\n## License\n\n[MIT](LICENSE.txt)\n","funding_links":["https://github.com/sponsors/blocknotes"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_jfu_upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocknotes%2Factiveadmin_jfu_upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocknotes%2Factiveadmin_jfu_upload/lists"}