{"id":14956054,"url":"https://github.com/peterconsuegra/multiple_files_by_pete","last_synced_at":"2026-01-21T01:01:59.875Z","repository":{"id":56884812,"uuid":"443595665","full_name":"peterconsuegra/multiple_files_by_pete","owner":"peterconsuegra","description":"An agile way to implement multiple files uploads in Ruby On Rails scaffold without the need to create additional tables","archived":false,"fork":false,"pushed_at":"2022-01-04T20:04:10.000Z","size":433,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T23:52:11.684Z","etag":null,"topics":["javascript","ruby","rubyonrails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterconsuegra.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-01T18:07:43.000Z","updated_at":"2024-08-04T13:35:18.000Z","dependencies_parsed_at":"2022-08-20T13:10:45.754Z","dependency_job_id":null,"html_url":"https://github.com/peterconsuegra/multiple_files_by_pete","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterconsuegra/multiple_files_by_pete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterconsuegra%2Fmultiple_files_by_pete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterconsuegra%2Fmultiple_files_by_pete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterconsuegra%2Fmultiple_files_by_pete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterconsuegra%2Fmultiple_files_by_pete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterconsuegra","download_url":"https://codeload.github.com/peterconsuegra/multiple_files_by_pete/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterconsuegra%2Fmultiple_files_by_pete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28620572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","ruby","rubyonrails"],"created_at":"2024-09-24T13:12:14.573Z","updated_at":"2026-01-21T01:01:59.680Z","avatar_url":"https://github.com/peterconsuegra.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby On Rails multiple files by Pete\n\nAn agile way to implement multiple files uploads in a Ruby On Rails scaffold without the need to create additional tables\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'multiple_files_by_pete'\n```\n\nAnd then execute:\n\n    $ bundle install\n\n## Support\n\nRuby On Rails: 5, 6, 7\n\nThis gem does not work with SQLite database\n\n## Usage\nLet's create a example for a Place scaffold:\n\n1. Let's create a new rails app:\n\n```ruby\nrails new myapp --database=postgresql\n```\n\n2. Create the database:\n\n```ruby\nbundle exec rake db:create\n```\n\n3. Go to your application's directory in Terminal and run the command:\n\n```ruby\nbundle exec rails g scaffold Place name:string description:text\n```\n\n4. Add this line to your application's Gemfile:\n\n```ruby\ngem 'multiple_files_by_pete'\n```\n\n5. Go to your application's directory in Terminal and run:\n\n```ruby\nbundle install\n```\n\n6. 6. Go to the application directory in Terminal and run the following command to install the necessary code and files from the gem:\n\n```ruby\nbundle exec rake 'multiple_files_by_pete[place]'\n```\n\n7. Add jQuery to your layout file:\n\n```html\n\u003cscript src='/multiple_files_by_pete/jquery-3.6.0.min.js'\u003e\u003c/script\u003e\n```\n\n8. Add bootstrap.min.css to your layout file:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"/multiple_files_by_pete/bootstrap.min.css\"\u003e\n```\n\n9. Copy and paste this code to get all the object files. For this example paste it in the edit action of the places_controller.rb file\n\n```ruby\n@files = PeteFile.get_object_files(@place)\n```\n\n10. Copy paste this code for each file field you need, you can add as many as you want by changing the section variable. For this example paste it into the /places/_form.html.erb file:\n\n```ruby\n\n\u003c%= render partial: 'shared/files_by_pete', locals: {model: @place, files: @files, section: 'legal_files' ,label: 'Upload legal files'}  %\u003e\n\n\u003c%= render partial: 'shared/files_by_pete', locals: {model: @place, files: @files, section: 'extra_files' ,label: 'Upload extra files'}  %\u003e\n\n```\n\n11. Copy and paste this code at the end of the form where you have added the file fields. The size limit is in MB. For this example paste it in the file /places/_form.html.erb:\n\n```ruby\n\u003c%= render 'shared/files_by_pete_js', model: @place, size_limit: 50%\u003e\n```\n\nVideo Tutorial\n===============\n\nWatch this video to see how it works\n\n[![IMAGE ALT TEXT HERE](https://raw.githubusercontent.com/peterconsuegra/multiple_files_by_pete/master/templates/multiple_files_by_pete.png)](https://www.youtube.com/watch?v=Oy5W9dalN9M)\n\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/peterconsuegra/multiple_files_by_pete. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/peterconsuegra/multiple_files_by_pete/blob/master/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the MultipleFilesByPete project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/peterconsuegra/multiple_files_by_pete/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterconsuegra%2Fmultiple_files_by_pete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterconsuegra%2Fmultiple_files_by_pete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterconsuegra%2Fmultiple_files_by_pete/lists"}