1. 08 6月, 2015 1 次提交
    • G
      Raise an ArgumentError when `include_blank` is false for a required field in · 07754073
      Grey Baker 提交于
      `Tags::Base#select_content_tag`.
      
      Previously, passing a falsey value to `include_blank` would be ignored if the
      field was required, and a blank line would still be inserted. The following will
      now raise instead of quietly failing:
      
      `select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
      07754073
  2. 07 6月, 2015 1 次提交
  3. 03 6月, 2015 1 次提交
  4. 24 5月, 2015 1 次提交
  5. 20 5月, 2015 2 次提交
  6. 14 5月, 2015 1 次提交
    • H
      Do not put partial name to local_assigns when rendering without an object · bef9484c
      Henrik Nygren 提交于
      When one rendered a partial template without specifying an object
      or a collection (e.g. <%= render partial: 'partial_name' %>), Rails
      would make an object called :partial_name available in local_assigns.
      I don't think this was the intended behavior, since no local variable
      called 'partial_name' gets defined in the view.
      bef9484c
  7. 09 5月, 2015 1 次提交
  8. 08 5月, 2015 3 次提交
  9. 05 5月, 2015 2 次提交
  10. 03 5月, 2015 1 次提交
  11. 02 5月, 2015 1 次提交
  12. 01 5月, 2015 1 次提交
    • Y
      Revert "Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition" · 14d0e070
      Yves Senn 提交于
      This reverts commit d459b001, reversing
      changes made to 4d4950fa.
      
      😓
      
      The block is not supposed to be passed to `link_to`. It's used for a
      customized behavior of the `condtion = false` case. The docs
      illustrate that like so:
      
      ```
      <%=
         link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
           link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
         end
      %>
      ```
      14d0e070
  13. 29 4月, 2015 1 次提交
  14. 24 4月, 2015 2 次提交
    • D
      Correct translate helper docs [ci skip] · 6ad5e7eb
      Derek Prior 提交于
      The documentation previously stated that calling `translate(".foo")` was
      equivalent to calling `I18n.translate("people.index.foo")` which is
      incorrect due to the various other functions of the `translate` view
      helper. This has been fixed.
      
      Additionally, a note about forcing the view helper to re-raise
      exceptions was added to the section detailing the handling of missing
      translations.
      
      Other cleanup includes:
      
      * Consistent formatting of code
      * Stop indenting bulleted list as a code sample
      * Tighten some of the language
      * Wrap at 80 characters.
      6ad5e7eb
    • M
      8cbeec77
  15. 21 4月, 2015 1 次提交
  16. 16 4月, 2015 2 次提交
  17. 14 4月, 2015 1 次提交
  18. 10 4月, 2015 1 次提交
  19. 08 4月, 2015 2 次提交
  20. 06 4月, 2015 2 次提交
  21. 05 4月, 2015 1 次提交
    • A
      Allow an array to be a default translation value. · 6f3c65f6
      Adam Prescott 提交于
      4.2.1 introduced a change to the way `translate`/`t` works with an
      option of `default: [[]]`. In 4.2.0, this would give a default value of
      `[]`, but in 4.2.1, it leads to a missing translation.
      
      `default: [[]]` is again allowed for cases where a default of `[]` is
      needed.
      
      This addresses GitHub issue 19640.
      6f3c65f6
  22. 04 4月, 2015 2 次提交
  23. 02 4月, 2015 2 次提交
    • B
      Freeze static arguments for gsub · 58d75fd8
      brainopia 提交于
      58d75fd8
    • B
      Prefer string patterns for gsub · cdac52e1
      brainopia 提交于
      https://github.com/ruby/ruby/pull/579 - there is a new optimization
      since ruby 2.2
      
      Previously regexp patterns were faster (since a string was converted to
      regexp underneath anyway). But now string patterns are faster and
      better reflect the purpose.
      
        Benchmark.ips do |bm|
          bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') }
          bm.report('string') { 'this is ::a random string'.gsub('::', '/') }
          bm.compare!
        end
        # string: 753724.4 i/s
        # regexp: 501443.1 i/s - 1.50x slower
      cdac52e1
  24. 01 4月, 2015 1 次提交
  25. 27 3月, 2015 2 次提交
  26. 25 3月, 2015 1 次提交
  27. 23 3月, 2015 1 次提交
  28. 22 3月, 2015 1 次提交
    • C
      Rework form helper example to use Person.new · 9f98cf55
      Carlos Antonio da Silva 提交于
      The previous change 92a3c8dc improved
      this example, but calling .create + #valid? ends up running validations
      twice, and we don't want to showcase that.
      
      Lets use the normal use case of building a new object and calling #save
      on it, which is what a basic scaffold with Active Record does.
      
      [ci skip]
      9f98cf55
  29. 21 3月, 2015 1 次提交