1. 09 12月, 2013 4 次提交
    • D
      Revert "Merge pull request #13235 from strzalek/variants-inline" -- needs a little more work! · 4aae538d
      David Heinemeier Hansson 提交于
      This reverts commit 18616114, reversing
      changes made to cad9eb17.
      4aae538d
    • D
      Merge pull request #13235 from strzalek/variants-inline · 18616114
      David Heinemeier Hansson 提交于
      Inline syntax for variants
      18616114
    • Ł
      Inline variants syntax · 2647d2f6
      Łukasz Strzałkowski 提交于
      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 sitiations:
      
        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
      2647d2f6
    • Ł
      Simplify @responses hash initialization · 9b8c0ff3
      Łukasz Strzałkowski 提交于
      @responses hash needs to be initialized with mime types that we get from
      Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as
      value. This need to happen before content negotiation. Before that, it was
      looping though mime types and executing mime-type-generated method inside
      collector (see
      AbstractController::Collector#generate_method_for_mime). That approach resulted
      in 2 unnecessary method calls for each mime type
      collected by Collector#collect_mimes_from_class_level.
      
      Now hash is initialized in place, without usage of Collector#custom method.
      9b8c0ff3
  2. 08 12月, 2013 6 次提交
  3. 07 12月, 2013 11 次提交
  4. 06 12月, 2013 19 次提交