This project is archived and is in readonly mode.
Comments and changes to this ticket
-
etozzato April 29th, 2009 @ 10:57 PM
- Title changed from ActionView::TextHelper Graceful Truncate to [Patch] ActionView::TextHelper Graceful Truncate
-
Michael Schuerig April 30th, 2009 @ 08:26 PM
If you're truncating text with tags, you'd have to make sure that the space you see is not inside of a tag.
-
Jeremy Kemper April 30th, 2009 @ 09:05 PM
Nice tweak, but the implementation is not multibyte compatible.
-
etozzato April 30th, 2009 @ 09:30 PM
Thanks for the feedback! I'll work on updating this patch.. now I see it's not ready :)
-
Pratik April 30th, 2009 @ 10:54 PM
- Title changed from [Patch] ActionView::TextHelper Graceful Truncate to ActionView::TextHelper Graceful Truncate
-
CancelProfileIsBroken August 6th, 2009 @ 02:20 PM
- Tag changed from actionpack, tested, text_helper, truncate to actionpack, bugmash, tested, text_helper, truncate
-
Elise Huard August 8th, 2009 @ 10:06 AM
+1 i've had to insert a method doing that several times on projects.
-
Steve St. Martin August 8th, 2009 @ 10:37 PM
-1 this functionality exists in master with options[:seperator] and probably should not be backported in a bugfix release
-
Elad Meidar August 8th, 2009 @ 11:21 PM
-1 exists and passes tests on master (+ multibyte), tested manually too.
-
Jeremy Kemper August 9th, 2009 @ 01:32 AM
- State changed from new to incomplete
Ok - anyone up for a :separator backport?
-
Steve St. Martin August 9th, 2009 @ 01:46 AM
- Title changed from ActionView::TextHelper Graceful Truncate to [PATCH] ActionView::TextHelper Graceful Truncate
I've attached a patch to backport options[:seperator] and its tests to 2-3-stable
-
Elad Meidar August 9th, 2009 @ 03:04 AM
+1 Back port patch applies cleanly on 2-3-stable, tests pass.
-
Hugo Peixoto August 9th, 2009 @ 03:33 AM
+1 The patch applies cleanly on 2-3-stable and the tests pass.
-
Jeremy Kemper August 9th, 2009 @ 08:59 PM
- Assigned user set to Jeremy Kemper
- Milestone changed from 2.x to 2.3.4
How about a test with multibyte :separator?
-
Steve St. Martin August 10th, 2009 @ 12:06 AM
In attempting to create a test case for this identified a bug with ActiveSupport
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets... , once this ticket is complete the patch can be updated.
-
Elad Meidar August 10th, 2009 @ 03:02 AM
I created a working patch for 2-3-stable and master on https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...
-
Elad Meidar August 10th, 2009 @ 04:01 AM
Trying to test an RTL input to truncate fails:
def test_truncate_multibyte_with_seperator with_kcode 'none' do assert_equal "אלעד ...", truncate("אלעד אוכל גזר כתום", :seperator => ' ', :length => 12) end with_kcode 'u' do assert_equal "אלעד ...", truncate("אלעד אוכלת גזר כתום", :length => 10, :seperator => ' ') end end 1) Failure: test_truncate_multibyte_with_seperator(TextHelperTest) [./test/template/text_helper_test.rb:77:in `test_truncate_multibyte_with_seperator' ./test/testing_sandbox.rb:7:in `with_kcode' ./test/template/text_helper_test.rb:76:in `test_truncate_multibyte_with_seperator' ./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__' ./test/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run']: <"אלעד ..."> expected but was <"אלעד או...">.
stevestmartin suggests it has something to do with the fact rindex is used, and i used an RTL language as input.
should there be any difference in RTL / LTR languages in this case ?
-
Steve St. Martin August 11th, 2009 @ 12:58 AM
now that rindex has been corrected, here is a patch with test case to be applied against both 2-3-stable and master as master does not have a test case for this.
previous backport patch still works against 2-3-stable
-
Jeremy Kemper September 11th, 2009 @ 11:04 PM
- Milestone changed from 2.3.4 to 2.3.6
[milestone:id#50064 bulk edit command]
-
Rizwan Reza January 20th, 2010 @ 11:47 AM
- Tag changed from actionpack, bugmash, tested, text_helper, truncate to actionpack, tested, text_helper, truncate
- State changed from incomplete to open
-
Rizwan Reza March 27th, 2010 @ 01:13 PM
- State changed from open to stale
- Milestone cleared.
stevestmartin, any chance you can provide a unified patch that applies to master? I will get it applied. And let's patch it against master only.
I am marking it as stale, please reopen and assign it to me when done. Thanks.
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3028 ActiveSupport::Multibyte::Chars completion of ticket #2582 depends on this, also causes b...