diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-02 16:18:03 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-02 16:18:03 -0500 |
commit | 942fe6514cc0db10c04fd2b46f8e1537beabef71 (patch) | |
tree | 8b9d057a91861756260aea7990308975305ab475 /actionpack/lib/action_view/helpers | |
parent | 02512914ae547eb664a78c0f6084b121d5283a61 (diff) | |
parent | ffe001f19dbbd9e697f6300650779f5e1391ce1e (diff) | |
download | rails-942fe6514cc0db10c04fd2b46f8e1537beabef71.tar.gz rails-942fe6514cc0db10c04fd2b46f8e1537beabef71.tar.bz2 rails-942fe6514cc0db10c04fd2b46f8e1537beabef71.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 860c1de6af..bfad9f8d31 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -43,25 +43,25 @@ module ActionView # ==== Examples # # truncate("Once upon a time in a world far far away") - # # => Once upon a time in a worl... + # # => "Once upon a time in a world..." # - # truncate("Once upon a time in a world far far away", :separator => ' ') - # # => Once upon a time in a world... + # truncate("Once upon a time in a world far far away", :length => 17) + # # => "Once upon a ti..." # - # truncate("Once upon a time in a world far far away", :length => 14) - # # => Once upon a... + # truncate("Once upon a time in a world far far away", :lenght => 17, :separator => ' ') + # # => "Once upon a..." # - # truncate("And they found that many people were sleeping better.", :omission => "... (continued)", :length => 25) - # # => And they f... (continued) + # truncate("And they found that many people were sleeping better.", :length => 25, :omission => '... (continued)') + # # => "And they f... (continued)" # # You can still use <tt>truncate</tt> with the old API that accepts the # +length+ as its optional second and the +ellipsis+ as its # optional third parameter: # truncate("Once upon a time in a world far far away", 14) - # # => Once upon a... + # # => "Once upon a..." # # truncate("And they found that many people were sleeping better.", 25, "... (continued)") - # # => And they f... (continued) + # # => "And they f... (continued)" def truncate(text, *args) options = args.extract_options! unless args.empty? |