{"id":26045385,"url":"https://github.com/zigomir/rubber_ring","last_synced_at":"2026-04-20T11:32:13.464Z","repository":{"id":56893098,"uuid":"9729606","full_name":"zigomir/rubber_ring","owner":"zigomir","description":"simple content editable cms","archived":false,"fork":false,"pushed_at":"2013-12-11T19:28:45.000Z","size":976,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-08T05:23:32.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zigomir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-28T12:11:44.000Z","updated_at":"2013-12-11T19:28:46.000Z","dependencies_parsed_at":"2022-08-20T16:10:39.919Z","dependency_job_id":null,"html_url":"https://github.com/zigomir/rubber_ring","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/zigomir/rubber_ring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Frubber_ring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Frubber_ring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Frubber_ring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Frubber_ring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zigomir","download_url":"https://codeload.github.com/zigomir/rubber_ring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Frubber_ring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32045231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T10:33:29.490Z","status":"ssl_error","status_checked_at":"2026-04-20T10:32:30.107Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2025-03-07T19:52:55.741Z","updated_at":"2026-04-20T11:32:13.447Z","avatar_url":"https://github.com/zigomir.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rubber Ring - simple content editable CMS\n[![Code Climate](https://codeclimate.com/github/zigomir/rubber_ring.png)](https://codeclimate.com/github/zigomir/rubber_ring)\n\n## About\n\nThis CMS helps you build editable pages fast. You define which content\n(`text`, `image`, `attachment`, ...) should be editable for your users.\nLimitation, that only developer sets what page parts are editable is good for\nkeeping the design intact. It is basically backend for saving `contenteditable` content.\nWhen done editing, only static assets will be published to production server\nwhere you only need a web server like Apache or Nginx.\n\nNamed by The Smiths [song](http://www.youtube.com/watch?v=Cpf6gJU3520).\n\n## Benefits over other content editable CMSes\n\n- optimized for developers and quick setup\n- simple to use for customers. They should not be able to break design (a lot)\n- customer doesn't need application server and/or database. Only plain web server for static HTML serving will do\n\n### This CMS is not good for\nsites, where **editor** wants to create new pages and control each part of every page,\nchange fonts and text style\n\n## Software prerequisites\n\n* Ruby 2\n* Rails 4\n* sqlite3\n* imagemagick\n* wget\n\n## Versions\n\nUse `gem 'rubber_ring', '~\u003e 0.1.2'` if you don't want to run multiple processes. Instead you will need to publish each\nchange of any page separately.\n\nUse `gem 'rubber_ring', '~\u003e 1.0.0'` if you can have two or more processes of web server. In this version whole site\nwill be built in one step.\n\n### Browser support\n\nFirefox, Chrome and Safari.\n\n## Setup\n\n### Dependencies\nTo install `imagemagick` and `sqlite3` on `Ubuntu`\n\n\tsudo apt-get install imagemagick\n\tsudo apt-get install libsqlite3-dev\n\n## Setting up a new project\n\nAdd this to your `Gemfile`\n\n\tgem 'rubber_ring'\n\nCreate and migrate database\n\n    rake rubber_ring:install:migrations\n    rake db:create db:migrate\n\nUpdate `development.rb` to enable build for development mode. This will disable rails to add `body=1` to every asset link.\n\n```ruby\nconfig.assets.debug = false\n```\n\n### Generate config files\n\n\trails generate rubber_ring:install\n\nThis will generate\n\n\t1. app/config/publish.yml\n\t2. app/config/initializers/rubber_ring.rb\n\t3. app/views/layouts/rubber_ring/layout.html.erb\n\t4. app/assets/javascripts/application.js\n\t5. public/.htaccess\n\n1. Set your production server name and path. You will need SSH access and your public key\non server. If you tend to use Rubber Ring as part of web application, or you don't want/need to publish only static HTML files, you can ignore this file.\n2. Set admin password and application type in `app/config/initializers/rubber_ring.rb`.\n3. `app/views/layouts/rubber_ring/layout.html.erb` is here for you to override it,\nso you have complete control over your markup.\n4. This is copied because default Rails `application.js` includes `jquery` which is\nalready included for you by Rubber Ring (avoiding clashes).\n5. Apaches access config. Including rules so you can access all published pages. It will\nlook for `.html` files first and enter sub directories later. Example: we have page with\nroute `/en` and `/en/example`. When published, `en.html` and `en/example.html` will be\ngenerated and synced with production server. To serve them both we need this `.htaccess` file.\n\n### Run\n\n### Static pages or Rails application?\n\nIf you only want to use Rubber Ring to generate static pages, leave\n`RubberRing.static_only = true` inside `app/config/initializers/rubber_ring.rb` intact.\nThis will leave you with options to `preview` and `publish` html pages and other\nassets to production server. Otherwise set\nthis option to false.\n\n# Usage\n\n## As an editor I want to easily edit content on my site\n\nLogin at URL `/rubber_ring` with password which was set by developer in the install stage.\n\nJust edit content inside green boxes.\nDeveloper sets what content is editable/repeatable/link/multi line...\n\nFor changing images click on `Image manager` in the upper menu.\nDrag and drop the image(s) you need to drop zone. After uploading the\nimage(s) you can drag and drop them on the image you wanted to change.\nImage will be automatically re-sized to the size that was set by developer/designer.\n\n### Preview\n\nThe easiest way to preview your current work is to log out or even better, open it in\na new browser where you are not logged in.\n\n### Build and publish your pages\n\n`Build \u0026 Publish` option in the menu will first output entire page to `public/build` directory. `Publish` will upload/copy whole site to your production server, set in `publish.yml` file.\n\n## As a developer I want to quickly setup editable pages\n\nRails generator for new pages\n\n    rails generate rubber_ring:page home action1 action2\n\nThis will create files and new routes to `routes.rb` file\n\n    create app/controllers/home_controller.rb\n    create app/views/home/action1.html.erb\n    create app/views/home/action2.html.erb\n    route get 'home/action1'\n    route get 'home/action2'\n\n### Rubber Ring helpers\n\nCMS fields are made of tag, key and `@page` which holds content for all the page keys/value pairs.\n\nExamples\n\n```erb\n\u003c%= editable_field(:h1, {key: 'header'}, @page) do %\u003e\n  I'm editable content in one line.\n\u003c% end %\u003e\n\n\u003c%= editable_field(:div, {key: 'first_content', class: 'multi-line'}, @page) do %\u003e\n  I'm editable content in\n  multi lines...\n\u003c% end %\u003e\n\n\u003c%= editable_link({class: 'rubber_ring_attachment', key: 'attachment-link', href: '/link-to-something'}, @page) do %\u003e\n\tLink to PDF\n\u003c% end %\u003e\n\n\u003c%= editable_image({key: 'header_image', src: image_path('baws.jpg'), height: '360'}, @page) %\u003e\n```\n\n## Templates\n\nAllows you to set up repeating and sortable templates. Example\n\n```erb\n\u003c% template([\n    {template: 'article',   tclass: 'article', element: 'article'},\n    {template: 'blog_post', tclass: 'blog',    element: 'div'}\n  ],\n  {key: 'template_key', wrap_element: 'div', wrap_class: 'templates'}, @page)\n%\u003e\n```\n\nThis means, that you need to create new view for each template in\n`app/views/templates/`. Example\n\n    app/views/templates/_article.html.erb\n\nConvention\n\n\t...\n\t{template: 'article', ...\n\t...\n\nmeans that you need a view, saved in a file\n\n    app/views/templates/_article.html.erb\n\n**Inside templates** you can use all other helpers. **BUT**, you need to\nassemble your key correctly or otherwise you will be overwriting your own content.\nYou can use `key_prefix`, which is assembled the way which will help you to prevent key overwites. Example:\n\n```erb\n\u003c%= editable_field(:h2, {key: \"#{key_prefix}_title\"}, @page) do %\u003e\n\tArticle Title\n\u003c% end %\u003e\n```\n\n### Helper options\n\nEach helper needs to specify unique `key`. These are holding values in the database.\nAlso each helper needs to include `@page` object as their last parameter.\nThis object holds all the editable content of the page in a hash data structure.\n\n#### reserved key(s) - don't use them\n\n- `page_title`\n\n#### helper arguments for all editable fields\n- `key` key to hold the value **(must be unique)**\n- `class` html class attribute (optional)\n\t- class value with `multi-line` will enable editing in multi lines\n- `id` html id attribute (optional)\n- `@page` object for holding page content\n\n#### specific arguments for each field\n- `editable_image`\n\t- `src` image source attribute\n\t- `width` image width\n\t- `height` image height\n- `editable_field`\n\t- no specific arguments\n- `editable_link`\n\t- `href` specifies link to page / file\n\t- if you set or add a class called `rubber_ring_attachment` to `editable_link` you can drop new attachments to it\n\n### Assets (stylesheets and javascripts)\n\nYou can use, like in any other Rails application,\n[sprockets directives](https://github.com/sstephenson/sprockets#the-directive-processor)\nto include assets to your app.\nPlease don't use `//= require jquery` and `//= require jquery-ui`\nin your `application.js` file, because rubber ring is already including `jquery`\nwhich you can reuse in your pages as well.\n\n## Philosophy\n\n* user should not be able to break design\n* you can not build robust system without limitations\n* system may stretch only to certain point until it breaks. Like a rubber ring!\n\n## Inspired by (aka ideas stolen from)\n\n- [Mercury Editor](http://jejacks0n.github.io/mercury/)\n- [Raptor Editor](http://www.raptor-editor.com/)\n- [Copybar](https://copybar.io)\n- [Perch](http://grabaperch.com/)\n- [CopyCopter](http://copycopter.com)\n- [SimpleCMS](http://www.simplecms.com)\n- [Squarespace](http://www.squarespace.com/)\n- [contenteditable editors](http://stackoverflow.com/questions/6756407/what-contenteditable-editors-are-there)\n\n---\nThis project uses MIT-LICENSE. Copyright 2013 Žiga Vidic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigomir%2Frubber_ring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigomir%2Frubber_ring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigomir%2Frubber_ring/lists"}