search for: truncate_str

Displaying 3 results from an estimated 3 matches for "truncate_str".

2006 Jan 23
2
problem with options_for_select
...he docs say that the selected element may be an array of values, but I can''t get it to work. Any ideas? My code is below. Thanks in advance. Sean <select name="publisher_ids[]"> <%= options_for_select (@publishers.map {|p| [truncate (p.publisher_name, length = 30, truncate_string = "..."), p.id]}, @book.publishers )%> </select>
2007 Mar 29
1
improving on: truncate(..) + rendered text ?
Hello all, In a summary page I need to show the 1st 100 chars of textilized messages. Problem: truncate(..) would often cut in the middle of html tags => random result. My first idea was to "repair" the broken text with Hpricot (as I use it elsewhere in the project), but it''s not perfect: <h1>abcd</h would give <h1>abcd</h</h1> (I also use
2007 Feb 17
0
Truncate and textilize
Hi, this is probably an obvious question, but I want to textilize and truncate the same thing. Nesting them in parenthesis didn''t seem to work for me. Here is what I have: <%= truncate(friend.about_me, length = 140, truncate_string = "...") %> How do I get it to recognize textile as well? Thanks! Dave -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group...