diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-12 07:59:17 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-12 07:59:17 -0800 |
commit | 1454f2c20a988e320f4f9466caae83b59f959c3b (patch) | |
tree | a4d7b152507a951fd8d12be6ff59d0feddb51d45 /guides | |
parent | 02a81b84ebb7fc16dc2ae4609277e8251f232f95 (diff) | |
parent | 3ce9563d42cbec3db69ac31161532460b84abe3a (diff) | |
download | rails-1454f2c20a988e320f4f9466caae83b59f959c3b.tar.gz rails-1454f2c20a988e320f4f9466caae83b59f959c3b.tar.bz2 rails-1454f2c20a988e320f4f9466caae83b59f959c3b.zip |
Merge pull request #13290 from strzalek/inline-syntax-docs
Variants inline syntax documentation
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/4_1_release_notes.md | 10 |
1 files changed, 10 insertions, 0 deletions
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 |