aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb
Commit message (Collapse)AuthorAgeFilesLines
* Inline variants syntaxŁukasz Strzałkowski2013-12-101-0/+1
In most cases, when setting variant specific code, you're not sharing any code within format. Inline syntax can vastly simplify defining variants in those situations: respond_to do |format| format.js { render "trash" } format.html do |variant| variant.phone { redirect_to progress_path } variant.none { render "trash" } end end Becomes: respond_to do |format| format.js { render "trash" } format.html.phone { redirect_to progress_path } format.html.none { render "trash" } end