Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update the documentation and add CHANGELOG entry

  • Loading branch information...
commit eedc513503785490a7caed23cd0a0aef3536759f 1 parent 4ce3b5d
Rafael Mendonça França rafaelfranca authored
2  actionpack/CHANGELOG.md
Source Rendered
... ... @@ -1,5 +1,7 @@
1 1 ## Rails 4.0.0 (unreleased) ##
2 2
  3 +* `truncate` now accepts a block to show extra content when the text is truncated. *Li Ellis Gallardo*
  4 +
3 5 * Add `week_field`, `week_field_tag`, `month_field`, `month_field_tag`, `datetime_local_field`,
4 6 `datetime_local_field_tag`, `datetime_field` and `datetime_field_tag` helpers. *Carlos Galdino*
5 7
6 actionpack/lib/action_view/helpers/text_helper.rb
@@ -62,9 +62,9 @@ def safe_concat(string)
62 62 #
63 63 # Pass a <tt>:separator</tt> to truncate +text+ at a natural break.
64 64 #
65   - # The result is not marked as HTML-safe, so will be subject to the default escaping when
66   - # used in views, unless wrapped by <tt>raw()</tt>. Care should be taken if +text+ contains HTML tags
67   - # or entities, because truncation may produce invalid HTML (such as unbalanced or incomplete tags).
  65 + # Pass a block if you want to show extra content when the text is truncated.
  66 + #
  67 + # The result is marked as HTML-safe, but the it is escaped first.
68 68 #
69 69 # truncate("Once upon a time in a world far far away")
70 70 # # => "Once upon a time in a world..."
2  activesupport/lib/active_support/core_ext/string/filters.rb
@@ -33,7 +33,7 @@ def squish!
33 33 # # => "Once upon a time in a..."
34 34 #
35 35 # The last characters will be replaced with the <tt>:omission</tt> string (defaults to "...")
36   - # for a total length not exceeding <tt>:length</tt>:
  36 + # for a total length not exceeding <tt>length</tt>:
37 37 #
38 38 # 'And they found that many people were sleeping better.'.truncate(25, :omission => '... (continued)')
39 39 # # => "And they f... (continued)"

0 comments on commit eedc513

Please sign in to comment.
Something went wrong with that request. Please try again.