{"id":18255787,"url":"https://github.com/bootstrap-ruby/bootstrap-editable-rails","last_synced_at":"2025-08-31T12:17:14.248Z","repository":{"id":5819755,"uuid":"7035020","full_name":"bootstrap-ruby/bootstrap-editable-rails","owner":"bootstrap-ruby","description":"In-place editing with Twitter Bootstrap for Rails","archived":false,"fork":false,"pushed_at":"2020-01-27T15:26:23.000Z","size":698,"stargazers_count":216,"open_issues_count":14,"forks_count":52,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T06:07:20.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rubygems.org/gems/bootstrap-editable-rails","language":"JavaScript","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/bootstrap-ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-06T12:09:01.000Z","updated_at":"2023-11-02T14:32:37.000Z","dependencies_parsed_at":"2022-08-30T08:00:08.702Z","dependency_job_id":null,"html_url":"https://github.com/bootstrap-ruby/bootstrap-editable-rails","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-editable-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-editable-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-editable-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bootstrap-ruby%2Fbootstrap-editable-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bootstrap-ruby","download_url":"https://codeload.github.com/bootstrap-ruby/bootstrap-editable-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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":[],"created_at":"2024-11-05T10:18:43.295Z","updated_at":"2025-04-04T07:06:36.189Z","avatar_url":"https://github.com/bootstrap-ruby.png","language":"JavaScript","readme":"# Bootstrap Editable Rails\n\nIn-place editing with Twitter Bootstrap for Rails 3/4\n\nThis gem is based on X-editable (v1.5.1) which is the new version of Bootstrap Editable.\n\nhttps://github.com/vitalets/x-editable\n\n## Demo \u0026 Documents\n\nSee http://vitalets.github.com/x-editable\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'bootstrap-editable-rails'\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\n### JavaScript \u0026 Stylesheet\n\nWrite the top of `app/assets/javascripts/application.js` like this:\n\n```javascript\n//= require jquery\n//= require jquery_ujs\n//= require bootstrap\n//= require bootstrap-editable\n//= require bootstrap-editable-rails\n//= require_tree .\n```\n\nand need to load `bootstrap-editable.css` at the place where you like.\n\n### HTML\n\nFollow the documents of X-editable above.\n\nAdditional required attribute is `resource`.\n\n```html\n\u003ca href=\"#\" id=\"username\" data-type=\"text\" data-resource=\"post\" data-name=\"username\" data-url=\"/posts/1\" data-original-title=\"Enter username\"\u003esuperuser\u003c/a\u003e\n```\n\nthen, sends `PUT /posts/1` request with the body:\n\n```\npost[username]=superuser\n```\n\nWhen using `textarea` type, `textarea_format` helper method for formatting line breaks is available.\n\n```html\n\u003ca href=\"#\" id=\"body\" data-type=\"textarea\" data-resource=\"post\" data-name=\"body\" data-url=\"/posts/1\" data-original-title=\"Enter body\"\u003e\n  \u003c%= textarea_format(@post.body) %\u003e\n\u003c/a\u003e\n```\n\n### Controller\n\nPostsController receives the parameters\n\n```\n{ \"id\" =\u003e \"1\", \"post\" =\u003e { \"username\" =\u003e \"superuser\" } }\n```\n\nand must respond with 2xx (means _success_) status code if successful.\n\nFor example, scaffold works well by 204 because default dataType is json.\n\n```ruby\ndef update\n  @post = Post.find(params[:id])\n\n  respond_to do |format|\n    if @post.update_attributes(params[:post])\n      format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n      format.json { head :no_content } # 204 No Content\n    else\n      format.html { render action: \"edit\" }\n      format.json { render json: @post.errors, status: :unprocessable_entity }\n    end\n  end\nend\n```\n\n#### Note\n\nThe scaffold above will not work with jQuery 1.9.0 (included in jquery-rails 2.2.0) because of jQuery's bug.\n\nhttps://github.com/jquery/jquery/pull/1142\n\nIf you use the old version of jQuery, please update jquery-rails to avoid it.\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-editable-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-editable-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbootstrap-ruby%2Fbootstrap-editable-rails/lists"}