# Redacted [](https://circleci.com/gh/kurtfunai/redacted/tree/master) [](https://codeclimate.com/github/kurtfunai/redacted) [](https://codeclimate.com/github/kurtfunai/redacted) The goal of Redacted is to take text like `My maple syrup was stolen by a moose!` and black it out, just like on a top secret document! To keep the redacted information private, it turns the text into [Lorem ipsum](http://www.lipsum.com/). It tries its best to maintain the same size & shape of the text that is being redacted. Redacted works with both plain text and HTML. ## Installation Add this line to your application's Gemfile: ```ruby gem 'redacted' ``` And then execute: ```bash $ bundle ``` In your application.css, include the css file: ```css /* *= require redacted */ ``` ## Usage After installing the gem, you will have access to a couple new methods in your Rails Views. **redact(str)** ```ruby # Plain text (inline): <%= redact("You know nothing Jon Snow") %> #=> Iusto eos eligendi non iu All of the maple syrup was stolen by <%= redact("aliens") %>. #=> All of the maple syrup was stolen by ducimu # Plain text (paragraphs): <%= redact("Roses are red.\nViolets are blue.\n\nAll our base\r\n are belong to you.") %> #=>
consequatur et
excepturi sed dol
maxime id su
at non quia nonotas
``` The `#redact` method will try to guess if the text should be inline or not, but you can also explictly call `redact_text(str)` for inline rendering, or `redact_paragraphs(str)` for paragraphs wrapped in `` tags. **redact_html(html_str)** ```ruby redact_html("
A mind needs books as a sword needs a whetstone
if it is to keep its edge.
adipisci labore quae perferendis impedit autem
odit impedit dolorem rerum