:body render options.
This is a continuation from #12374, with slight modification since the discussion went a bit off-topic.
In order to reduce confusion, we're introducing 3 more render format to
render html: '<strong>HTML String</strong>'.html_safe # render with `text/html` MIME type. render plain: 'plain text' # render with `text/plain` MIME type. render body: 'raw body' # render raw content, does not set content type.
We want to phrase out the usage of
The text was updated successfully, but these errors were encountered:
I can respond to reviews this morning! Sorry for the delay.
On Tue, Feb 18, 2014 at 5:10 AM, David Heinemeier Hansson
This is an option for sending a raw content back to browser. Note that this rendering option will unset the default content type and does not include "Content-Type" header back in the response. You should only use this option if you are expecting the "Content-Type" header to not be set. More information on "Content-Type" header can be found on RFC 2616, section 7.2.1. Please see rails#12374 for more detail.
This is an option for to HTML content with a content type of `text/html`. This rendering option calls `ERB::Util.html_escape` internally to escape unsafe HTML string, so you will have to mark your string as html safe if you have any HTML tag in it. Please see rails#12374 for more detail.
* master: (1455 commits) change 'assert !' to 'assert_not' in guides [ci skip] Pointing to latest guides [ci skip] Methods silence_stream/quietly are not thread-safe [skip ci] [ci skip] Close the meta tag with '/>' instead of '>' Fix render plain docs example in AM::Base Update Docs in favor to use render plain instead of text option ref #14062 Typo fix for unscope Use the reference for the mime type to get the format Preparing for 4.1.0.beta2 release Correctly escape PostgreSQL arrays. Escape format, negative_format and units options of number helpers Sync 4.1 release notes with changes since 7f648bc [ci skip] Update upgrading guide regarding `render :text` Add `#no_content_type` attribute to `AD::Response` Add missing CHANGELOG entry to Action View Update guides for new rendering options Cleanup `ActionController::Rendering` Fix a fragile test on `action_view/render` Introduce `render :html` for render HTML string Introduce `render :plain` for render plain text ... Conflicts: actionmailer/lib/action_mailer/railtie.rb railties/lib/rails/application.rb railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt