{"id":14955605,"url":"https://github.com/cedarcode/attorney","last_synced_at":"2025-10-08T18:01:53.229Z","repository":{"id":62553696,"uuid":"118480153","full_name":"cedarcode/attorney","owner":"cedarcode","description":"Easily define and mount Terms of Service, Privacy Policy and any other static page to your Rails app.","archived":false,"fork":false,"pushed_at":"2018-03-12T19:34:46.000Z","size":431,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T14:15:24.597Z","etag":null,"topics":["engine","legal","privacy-policy","rails","rails5","terms"],"latest_commit_sha":null,"homepage":"https://cedarcode.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedarcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-22T16:03:18.000Z","updated_at":"2023-08-17T11:09:06.000Z","dependencies_parsed_at":"2022-11-03T04:30:44.374Z","dependency_job_id":null,"html_url":"https://github.com/cedarcode/attorney","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fattorney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fattorney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fattorney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fattorney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedarcode","download_url":"https://codeload.github.com/cedarcode/attorney/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234725513,"owners_count":18877384,"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":["engine","legal","privacy-policy","rails","rails5","terms"],"created_at":"2024-09-24T13:11:26.324Z","updated_at":"2025-10-01T18:31:47.399Z","avatar_url":"https://github.com/cedarcode.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attorney\n\n[![Build Status](https://travis-ci.org/cedarcode/attorney.svg?branch=master)](https://travis-ci.org/cedarcode/attorney)\n[![Code Climate](https://codeclimate.com/github/cedarcode/attorney/badges/gpa.svg)](https://codeclimate.com/github/cedarcode/attorney)\n[![Gem Version](https://badge.fury.io/rb/attorney.svg)](https://badge.fury.io/rb/attorney)\n\nEasily define and mount `Terms of Service`, `Privacy Policy` and\n any other static page to your Rails app.\n\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'attorney'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install attorney\n```\n\n## Usage\n#### Mounting the engine\nFirst, mount the engine like any normal [Rails engine](http://guides.rubyonrails.org/engines.html#mounting-the-engine).\n In `config/routes.rb`:\n\n```ruby\nRails.application.routes.draw do\n  mount Attorney::Engine =\u003e '/legal'\nend\n```\nThis will add all the routes coming from the gem appended to the\n `/legal` path. Keep in mind that you can rename this anyway you want\n in your app, not necessarily `/legal`.\n\n#### Installing migrations\nNow, you will need to install the migrations by running the\n following command:\n```bash\n$ bin/rails attorney:install:migrations\n```\n\nThis will copy a migration file to your application. When ran,\n the migration will create a table named `attorney_documents`\n which is where all your Attorney related content will be stored.\n\n### Admin section\nAttorney comes with a simple admin section for managing your\n documents. The admin section uses a simple HTTP Auth for\n authorizing users. You should create two `ENV` variables for\n setting the credentials:\n\n```ruby\nATTORNEY_HTTP_AUTH_NAME\nATTORNEY_HTTP_AUTH_PASSWORD\n```\n\nBy default, auth name will be `attorney` and password will be\n `secret`. Please make sure to change those in production.\n\n### Creating documents\nAfter running the migrations, you should be ready to start creating\n your first documents. Start your server and navigate to\n `/legal/admin/documents`. You should see a basic CRUD for creating\n `documents`. Just follow the steps and start creating your docs.\n\n#### Slugs\nWhen you create your first document, you'll notice that there's a\n `slug` field in the form. A [slug](https://en.wikipedia.org/wiki/Slug_(publishing))\n is no more than a short human friendly name that serves as an\n identifier for your documents.\n\nFor example, if you have a `Terms and conditions` document, it might\n make sense to use a slug named `terms-and-conditions`. This will\n later be used to construct the URL that your users will have\n access to, like `/lega/terms-and-conditions`.\n\n#### Rich Editor\nAttorney relies on [CKEditor 4](https://ckeditor.com/ckeditor-4/#article)\n to provide a great Rich Editor for your document's content. This\n is a very flexible editor which will allow you to add titles,\n headings, bullet points and more. Check the examples in the link\n above to see what it is capable of.\n\nHere's a sample image of the Attorney editor:\n![Edit document image](docs/images/edit.png \"Edit document image\")\n\n### Publishing documents\nYou just need to check the `publish` checkbox and your document will\n be publicly accessible.\n\nEvery document is accessible through it's slugged URL. For example,\n if you have a `terms-and-conditions` document, then you should be\n able to see it by going to `/legal/terms-and-conditions` in\n your website. It's really as simple as that.\n\n### Configuring layout\nAttorney will attempt to use the `application` layout as\n default for displaying documents. If you need to use a different\n layout you can do it by adding the following configuration in\n  `config/initializers/attorney.rb`:\n\n```ruby\nAttorney.application_layout = 'your_own_layout'\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/cedarcode/attorney/ )\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 a new Pull Request\n\nSee the [Running Tests](RUNNING_TESTS.md) guide for details on how to run the test suite.\n\n## License\n\nThis project is licensed under the Mozilla Public License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarcode%2Fattorney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedarcode%2Fattorney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarcode%2Fattorney/lists"}