mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
a288cc1e01
Like `format.any`, you can do the same with variants. It works for both inline: respond_to do |format| format.html.any { render text: "any" } format.html.phone { render text: "phone" } end and block syntax: respond_to do |format| format.html do |variant| variant.any(:tablet, :phablet){ render text: "any" } variant.phone { render text: "phone" } end end |
||
---|---|---|
.. | ||
layouts | ||
all_types_with_layout.html.erb | ||
custom_constant_handling_without_block.mobile.erb | ||
iphone_with_html_response_type.html.erb | ||
iphone_with_html_response_type.iphone.erb | ||
using_defaults.html.erb | ||
using_defaults.xml.builder | ||
using_defaults_with_all.html.erb | ||
using_defaults_with_type_list.html.erb | ||
using_defaults_with_type_list.xml.builder | ||
variant_any_implicit_render.html+phablet.erb | ||
variant_any_implicit_render.html+tablet.erb | ||
variant_inline_syntax_without_block.html+phone.erb | ||
variant_plus_none_for_format.html.erb | ||
variant_with_implicit_rendering.html+mobile.erb |