From 610accd62425476ca2d05036794141cc999eeaa6 Mon Sep 17 00:00:00 2001 From: NanoMeko Date: Wed, 8 Feb 2017 13:00:35 -0600 Subject: [PATCH] Update README.md added instructions for displaying the trix saved html --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 79604742..f25c8f27 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Require Trix Javascript magic in `app/assets/javascripts/application.js`: //= require trix ``` -Finally, any place where you would like to use the Trix editor in your +Any place where you would like to use the Trix editor in your forms, just use the `trix_editor` helper: ```ruby @@ -48,6 +48,20 @@ f.input :body, as: :trix_editor ``` +Finally, when you want to display the contents of your form element: + + +```ruby +@post.fancyText.html_safe +``` + +or something more secure: + +```ruby +sanitize @post.fancyText, tags: %w(strong em p br div ul ol li) +``` + + ## Trix For the official Trix Github repository, go