{"id":23194145,"url":"https://github.com/glaucocustodio/remote_bootstrap_modal","last_synced_at":"2025-08-18T20:33:58.514Z","repository":{"id":56891733,"uuid":"150485449","full_name":"glaucocustodio/remote_bootstrap_modal","owner":"glaucocustodio","description":"A tiny Rails engine that helps you loading remote links into a bootstrap modal.","archived":false,"fork":false,"pushed_at":"2022-03-21T16:07:19.000Z","size":31,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T16:24:34.871Z","etag":null,"topics":["bootstrap","modal","rails-engine"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/remote_bootstrap_modal","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/glaucocustodio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-26T20:21:18.000Z","updated_at":"2023-03-02T14:55:32.000Z","dependencies_parsed_at":"2022-08-20T16:00:59.579Z","dependency_job_id":null,"html_url":"https://github.com/glaucocustodio/remote_bootstrap_modal","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Fremote_bootstrap_modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Fremote_bootstrap_modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Fremote_bootstrap_modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaucocustodio%2Fremote_bootstrap_modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glaucocustodio","download_url":"https://codeload.github.com/glaucocustodio/remote_bootstrap_modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230276310,"owners_count":18201092,"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":["bootstrap","modal","rails-engine"],"created_at":"2024-12-18T13:13:18.173Z","updated_at":"2024-12-18T13:13:18.829Z","avatar_url":"https://github.com/glaucocustodio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remote Bootstrap Modal\nA tiny Rails engine that helps you loading remote links into a bootstrap modal.\n\nIt was created based on the following post: https://jtway.co/5-steps-to-add-remote-modals-to-your-rails-app-8c21213b4d0c\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```sh\nbundle add remote_bootstrap_modal\n```\n\n## Requirements\n\n- Rails\n- Bootstrap\n\n## Usage\n\n1. Make sure you have bootstrap in your application\n2. Add this gem to your Gemfile\n3. Add the following div `\u003cdiv id=\"modal-holder\"\u003e\u003c/div\u003e` to your application layout (the modal will be rendered inside it)\n4. Add `//= require remote_bootstrap_modal` to your `app/assets/javascripts/application.js` (after jquery)\n5. Set the formats you need to respond with `respond_to` (ex: `respond_to :html, :json`)\n6. Call `respond_modal_with` in your controller passing the arguments you need\n7. Pass `data: { modal: true }` to links you want to load into a modal (ex: `link_to 'Customers', customers_path, class: 'btn btn-default', data: { modal: true }`)\n\n## Example\n\n```ruby\n# app/controllers/messages_controller.rb\nclass MessagesController \u003c ApplicationController\n  respond_to :html, :json\n\n  def new\n    @message = Message.new\n    respond_modal_with @message\n  end\n\n  def create\n    @message = Message.create(message_params)\n    respond_modal_with @message, location: messages_path\n  end\n\n  private\n\n  def set_message\n    @message = Message.find(params[:id])\n  end\n\n  def message_params\n    params.require(:message).permit(:name, :body)\n  end\nend\n```\n\n```ruby\n\u003c%# app/views/messages/index.html.erb %\u003e\n\u003c%= link_to 'Add Message', new_message_path, class: 'btn', data: { modal: true } %\u003e\n\n\u003c%# app/views/messages/_form.html.erb %\u003e\n\u003c%= simple_form_for(@message, remote: request.xhr?, html: { data: { modal: true } }) %\u003e\n```\n\n## Customization\n\nIt is an engine, you can override any file to customize, you can create a `app/views/layouts/modal.html.erb` for instance with the modal layout you want.\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaucocustodio%2Fremote_bootstrap_modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglaucocustodio%2Fremote_bootstrap_modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaucocustodio%2Fremote_bootstrap_modal/lists"}