similar to: simple_format, (long) urls, and wrapping

Displaying 20 results from an estimated 1000 matches similar to: "simple_format, (long) urls, and wrapping"

2009 Nov 30
6
rails 2.2.3 dirty.rb field_changed? method throwing arg error on creating an obj
I have a new model I''ve just built. It''s associated with another model via has_many. I''m trying to create one of these obj''s for the first time and I keep getting an Argument Error as follows: ArgumentError (wrong number of arguments (3 for 0)): C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.3/lib/ active_record/dirty.rb:135:in `field_changed?''
2009 Nov 26
15
bad move? - complex form with *many* observe_field's
I have a pretty complex form with many text fields and a number of selects. We let the user add multiple types of associated objects to the parent object and to edit the values for those associated objs, so the form can have something like the following number of fields on the page: 9 text fields + 3 selects + a*(1 text + 1 select) + b*(1 text + 1 select) + c*(1 text + 1 select) + d*(1 text +
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://www.ruby-forum.com/.
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/.
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 "Ruby on Rails: Talk" group. To post to this group, send email to
2009 Feb 24
2
Displaying line breaks & paragraphs using 'simple_format' ?
Hi there, I need to: 1. STORE a text of the below format in a (MySQL) database (using a ''textarea''), and then 2. RETRIEVE & DISPLAY it in exactly the same format (meaning: keeping all paragraphs/line breaks). The intended text format looks like this: *** Blah blahblah blah blah blahblah blah blah blahblah blah blah blahblah blah, blah blahblah. <- NEW
2010 Jan 27
2
has_many, through with nested models?
First the data model: class Forum < ActiveRecord::Base has_many :topics, :dependent => :destroy, :order => ''created_at desc'' end class User < ActiveRecord::Base has_many :topics, :dependent => :destroy has_many :comments, :dependent => :destroy has_many :replies, :dependent => :destroy end class Topic < ActiveRecord::Base belongs_to
2010 Sep 17
1
using OpenPGP gem and getting "out of range error"
I''ve been handed someone else''s code to debug, but am getting no further than he did... perhaps someone can help. We''re using the OpenPGP gem (http://openpgp.rubyforge.org/) to PGP- encrypt an XML file for submission to a third-party for processing. The prob is that when encrypting, we get errors like the following: RangeError: 1502 out of char range from
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 your to bio edit
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 "Ruby on Rails: Talk" group. To
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/. --~--~---------~--~----~------------~-------~--~----~ You received this
2010 Sep 23
1
Patch to fix docs for auto_link
Hi I''ve contributed a patch which fixes an incorrect example in the documentation for auto_link in ActionView::Helpers::TextHelper. The example uses truncate in the old style of tuncate(text, length) which no longer works, so I''ve patched it to use the new tuncate(text, :length => n) style.
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 Jun 04
5
Embedding link_to''s within text fetched from database.
Hi, I have the following problem that I can''t seem to figure out. I want to able to fetch some text from my database record in my controller, and then add two links within the text and then send that back to the view to get rendered so that the two links appear as links and when clicked on, they''d basically call the corresponding action for the link. Would anybody know how to
2006 Feb 10
4
RegEx Question
Hi, This is more of a Ruby question than Rails. I want to autolink url''s in a given string. I''m not great with regular expressions and I wandered if anybody has an example. Thanks.
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
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
2008 Dec 13
3
how to do "special queries" ala The Rails Way on "associated" conditions?
I have the following in a model class: class Game < ActiveRecord::Base has_many :player_stats has_many :players, :through => :player_stats def visitor_stats stats = [] player_stats.each do |stat| stats << stat if stat.player.team.team_code == self.visiting_team_code end stats end def home_stats stats = [] player_stats.each do |stat| stats << stat if