Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Inline variants syntax | Łukasz Strzałkowski | 2013-12-10 | 1 | -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 |