Permalink
Browse files

Merge pull request #30734 from oreoshake/patch-1

Encourage html-safe API in layouts/rendering guide
  • Loading branch information...
eileencodes committed Oct 4, 2017
2 parents f1e8962 + 521266f commit df2814671cce80fd0d8f290e5a70bf518880d6fa
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/layouts_and_rendering.md
@@ -232,14 +232,14 @@ You can send an HTML string back to the browser by using the `:html` option to
`render`:
```ruby
render html: "<strong>Not Found</strong>".html_safe
render html: helpers.tag.strong('Not Found')
```
TIP: This is useful when you're rendering a small snippet of HTML code.
However, you might want to consider moving it to a template file if the markup
is complex.
NOTE: When using `html:` option, HTML entities will be escaped if the string is not marked as HTML safe by using `html_safe` method.
NOTE: When using `html:` option, HTML entities will be escaped if the string is not composed with `html_safe`-aware APIs.
#### Rendering JSON

0 comments on commit df28146

Please sign in to comment.