search for: simple_format

Displaying 20 results from an estimated 28 matches for "simple_format".

2008 Jul 26
4
simple_format, (long) urls, and wrapping
I''m using simple_format to format and display posted content from users. This content sometimes has urls in it. The problem I''m having is that if the urls are long enough to wrap, they do, but the url gets split with a <br> tag. Then, if the user clicks on the link, only the first, non-wrapped part of the...
2006 Jan 04
2
simple_format and in_place_editor_field
Hi! How can i do to force an in_place_editor_field to format the text with simple_format while not editing? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/bbd141a2/attachment.html
2008 May 29
4
ruby's simple_format method is not working for spaces.
Ruby''s simple_format method is not working for spaces. so how to add and what to add in simple format method code so it also work for spaces? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "...
2006 Feb 09
0
Weird simple_format behavior
I''m working on a page combining Ajax.InPlaceEditor and the simple_format helper. The page is demonstrating some very strage behavior. First, here is the code: <p>Bio: </p> <div id="bio"> <% if @user.bio %> <%= simple_format( @user.bio ) %>\ <% else %> No Bio Yet <% end %> </div><em>(click on...
2009 Feb 24
2
Displaying line breaks & paragraphs using 'simple_format' ?
...ah. <- LINE BREAK Blah blahblah blah blah blahblah blah blah blahblah blah blah blahblah blah, blah blahblah. *** Until now: - the text is stored in exactly this format in a ''text'' field in the database (which I believe is the correct way to do it) - I have used ''simple_format'' (http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001719) for displaying The problem is: LINE BREAKS are displayed correctly, but NOT the PARAGRAPHS (they appear like simple line breaks). What am I doing wrong ?! Thanks a bunch for any hints and help ! Tom -- Pos...
2006 Oct 14
0
A not so simple simple_format helper
Hi, is there a not as simple simple_format helper in rails? :) I would like to keep the line breaks from the input, however, I would like to escape all other HTML elements. So basically it is the h() helper but keeps the line breaks. Any suggestions? Thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~-...
2009 Mar 26
0
reverse of simple_format?
Hello! Is there a way to reverse the TextHelper simple_format? I.e. to take some text with <p> tags and <br> tags and convert them into line breaks in a smart way? (smarter than just a regexp that is). TIA! -Danimal --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups &qu...
2006 Apr 18
12
Formatting data drawn from a DB
Question for all: Right now i have a Table in a mySQL DB that has a row called Ingredients. When the data is entered into the DB its enter like so from a text area: 1 1/2 lbs. beef top sirloin, thinly sliced 1/3 cup white sugar 1/3 cup rice wine vinegar 2 tablespoons frozen OJ concentrate 1 teaspoon salt 1 tablespoon soy sauce 1 cup long grain rice 2 cups water 1/4 cup cornstarch 2 teaspoons
2006 Apr 22
5
selenium plugin not working with rails 1.1
Hi, I really like selenium, and I just tried the plugin created Jonas Bengtsson. However I cannot get it to run on rails 1.1 and coundn''t find anyone complaining about it? Did anyone get it to run on rails 1.1.2? Greets, Abdur-Rahman
2006 Mar 30
2
How do I format text before saving it?
I tried to use a before_save and use simple_format, it returns and undefined method error. Can I even use these methods within a model? I tried to use auto_link and it failed too. What am I doing wrong? Furthermore, would it be recommended I format text before saving it to the database? Advantages or disadvantages? -- Posted via http://ww...
2007 Jan 16
2
Using view helpers in migrations?
I''m writing a bloggish/CMSish thing. I had been using simple_format, but my users requested a rich editor, so I added TinyMCE. Anyway, I was trying to migrate the existing content (since TinyMCE assumes it''s reading HTML-formatted text), and realized that I couldn''t call simple_format (or other helper methods) from Migrations. Can someone enligh...
2008 Jan 22
4
newlines in text_area
Hi @ all I would like to enter a text with a text_area into the database. It runs excellent. But when I want to show the entered text in the show view, all newlines (paragraphs) are deleted and the text is only one block. How can I save the returns (newlines) too? Thanks for helping!! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received
2006 Mar 01
0
TextHelpers in Controller?
I have a controller that saves info to the DB. It''s based on the AJAX scaffolding code. All I want to do is add a simple_format() function to it before I save a user-edited text field to the DB. TO convert line returns to <br>s, etc. @project_note = ProjectNote.new(params[:project_note]) @project_note.body = simple_format(@project_note.body) Since this happens in a controller, I guess it''s not kosher to u...
2006 Mar 15
4
RJS template eating encoding
...able to, say, put Japanese characters in. The problem is that when I switched this over to an RJS template it started eating the encoding. I now get garbage characters where before I got the correct ones. The code for the RHTML: <%= update_element_function( "front", :content => simple_format( h(@card.front_side))) %> <%= update_element_function( "back", :content => simple_format( h(@card.back_side))) %> and for RJS: page.replace_html ''front'', simple_format( h( @card.front_side ) ) page.replace_html ''back'', simple_format( h(...
2006 Apr 15
3
Dumb newbie question - text formatting?
I have a MySQL "text" element that I''m trying to display, but it''s not formatting (i.e. it''s all one big paragraph). In the AWD depot example it doesn''t look like they do anything special, but they get formatted text. I''ve tried it with both: <%= show.description %> - puts text, and formats according to any HTML tags I typed in.
2006 Aug 14
3
New line char in a text area field on DISPLAY
I have a text_area to accept upto 1000 chars, which is stored as a blob in mysql. When I try to display the saved data, I dont see the new line characters - however I could see the newline characters in EDIT MODE. So my newline char is lost during displaying. Any ideas how to fix it. thanks thila -- Posted via http://www.ruby-forum.com/.
2007 Jan 08
8
word wrap ?
Hi, I have long lines of text stored in a DB without line breaks. Now I need to present it in fixed width with word wrap. I tried everything css (word-wrap: break-word;), the rails actionview helper (word_wrap), specifying width of the div etc. But nothing works. The reason I''m asking the question here because to me word_wrap was created to solve this exact problem but it is failing to
2006 Jan 17
14
Going nuts on ''\n'' to <br />
Hi all, Is there no way to easily resolve this. It can''t be that I''m the first that wants this, and it wouldn''t be RoR if it''s not possible. On the mysql prompt with the select description from todos .. linefeeds are show, so they are there. This is the actual contents with a linefeed after the ":" "Project contacts: delete table, point
2006 Jan 25
11
Executing Ruby code that is inside a string
I would like to put Ruby code inside a string, between <%= %> tags, and have the code inside the tags executed when the string is displayed. Is this possible? -- Posted via http://www.ruby-forum.com/.
2006 Apr 13
4
equivilent to PHP''s nl2br?
Hey all, this is a pretty simple question but I can''t seem to find anything on the wikki or google... Is there a Ruby/Rails equivilent to PHP''s nl2br function? -- Posted via http://www.ruby-forum.com/.