From 3ce9563d42cbec3db69ac31161532460b84abe3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Thu, 12 Dec 2013 11:02:06 +0100 Subject: Variants inline syntax documentation [ci skip] * Extend method documentation * Mention it in actionpack/CHANGELOG * Update release notes --- guides/source/4_1_release_notes.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'guides') diff --git a/guides/source/4_1_release_notes.md b/guides/source/4_1_release_notes.md index 5c50ed83ea..3126f4e0e1 100644 --- a/guides/source/4_1_release_notes.md +++ b/guides/source/4_1_release_notes.md @@ -62,6 +62,16 @@ app/views/projects/show.html+tablet.erb app/views/projects/show.html+phone.erb ``` +You can also simplify the variants definition using the inline syntax: + +```ruby +respond_to do |format| + format.js { render "trash" } + format.html.phone { redirect_to progress_path } + format.html.none { render "trash" } +end +``` + ### Spring New Rails 4.1 applications will ship with "springified" binstubs. This means -- cgit v1.2.3