# Redacted The goal of Redacted is to take a block of text, turn it into Lorem ipsum of the same size, and then apply styles with CSS to make the text appear redacted! Just like top secret documents. Basically it takes a string like `My maple syrup was stolen by a moose!` and turns it into a blacked-out block of text that is roughly the same size. ## Installation Add this line to your application's Gemfile: gem 'redacted' And then execute: $ bundle In your application.css, include the css file: ``` /* *= require redacted */ ``` ## Usage Redacted will convert both plaintext and HTML into redacted text. After installing the gem, you will have access to a couple new methods in your Rails Views. **Plain text (inline):** ```ruby <%= redact('All of the maple syrup was stolen by aliens.')=> #=> Iusto eos eligendi non iure rerum quia accus All of the maple syrup was stolen by <%= redact('aliens')=>. #=> All of the maple syrup was stolen by ducimu ``` The plain text method can create inline redacted text, or write out paragraphs to maintain the size/shape of paragraphs. **Plain text (paragraphs):** ```ruby <%= redact('Roses are red.\nViolets are blue.\n\nAll our base\r\n are belong to you.')=> #=>
Roses are red.
Violets are blue.
All our base
are belong to you.
``` The `#redact` method will try to guess if the text should be inline or not, but you can also explictly call `redact_text` or `redact_paragraphs` if you want specific functionality. **HTML** ```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