Displaying 20 results from an estimated 1000 matches similar to: "How do I format text before saving it?"
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 link gets
posted to the browser... and that''s an invalid
2006 Aug 10
3
Want to use a view helper (TextHelper) in a model class
I have a model that deals with HTML and I want to use the
text_helper.sanitize method to strip the HTML of Javascript.
However, it doesn''t appear that I can get easy access to the text_helper
methods from within a model.
Anyone have any suggestions for how to do this?
In general, I think that there are some ActionView helpers which are
generic enough to want to use in a model class.
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/.
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 Mar 30
13
need an Ruby on Rails IDE
Hello everybody,
I''m a new member on Ruby on Rails.
I''m friendly on using Microsoft Visual Studio (VS) IDE.
The VS IDE supports for Intellisense coding (that mean it will
automatically display a list of member variables or functions for a
class, struct, union, or namespace; the names and types of parameters
required by a function or attribute; and the complete declaration for
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 enlighten me here?
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
2006 Mar 18
9
How do I write this SQL the Rails way?
I''m trying to find all the unique bill_number, status records in Bills
table. I can do it with a find_by_sql statement like this:
@records = Bill.find_by_sql( "select distinct bill_number, status
from bills
group by bill_number, status;")
How would I rewrite it using ''find :all
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
2006 Jan 30
3
Arrays of objects as parameters to webservices
I think I am missing something terribly obvious. Is it possible to have
an :expects parameter for a webservice that is an array of objects? I
want to have a single webservice that expects all my line items (for an
order). Is this something that is possible?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
2
Backslash Escaping in View
Ok, I''m hoping this won''t be a forehead slapper, but take a look at this code:
physician.name.sub(/''/, "\\''")
I''m trying to substitute a single quote with a backslash and a single
quote. This seems pretty simple right? Well, someone kick me and
tell me why it''s not :)
Here''s what I''m getting if the
2006 Feb 23
1
HABTM testing - fixtures not loading?
Hi,
I have a strange problem with testing classes which have a HABTM
relation. It seems that while running my tests with rake the fixture for
the association table is not loaded - as a result I get a failure on a
test which simply checks the number of associated elements - it says
it''s 0 although there should be one. The weird thing is that when I run
the tests with rcov
2005 Dec 16
0
auto_link fails to handle tilda''s (~) and markdown fails to handle acute accent (`)
Hi There,
So I was just having some trouble with auto_link and markdown.
Specfically auto_link was failing to handle urls with tildas in them (~)
e.g.
http://www.hawaii.edu/~name/index.html
and markdown couldn''t handle an acute accent (`) e.g.
Hawai`i
It seems that acute accents (or backticks) in Markdown signify code
segments, and it seems there''s an open ticket for this:
2006 Apr 20
1
fit testing, FitNesse
Hello,
this is a typical "how do you do it in Rails" question :) I would like
to incorporate fit testing into a RoR app and I''d like to hear your
recommendations on how to do it. In the ideal world I would like all the
table test definitions and implementations stored in svn together with
the app, ability to run the tests with a rake task + a hook to FitNesse,
so that
2006 Jan 02
0
problem with ruby gem activate when trying to run actionpack tests
Hi There,
so I worked out what I should be doing to try and contribute code to
rails (I''m currently working on patches for collection_select and
auto_link).
I''m following the instructions here:
http://dev.rubyonrails.org/
and have checked out actionpack. Trying to run the actionpack tests I
get this error:
D:\User\Code\ruby\actionpack\test>ruby controller/base_test.rb
2006 Mar 24
2
Return all rows, split then show uniques
I''m returning some rows from a tags database that look like this:
ID WORDS
1. apple banana pear
2. banana melon
3. apple peach lime
What I want to do with that data is use the .split method to divide them
into separate values in an array, then use the .uniq method to return a
unique list of the words like so:
apple, banana, pear, melon, peach, lime
So in my controller I
2006 Jul 18
4
Limiting markdown/textile
I''m using RedCloth for a forum type app. I want users to have control
over the look of their posts, but within limits. For example, I don''t
want them to be able to include images or use header tags. The RedCloth
documentation is pretty thin and I don''t feel it''s very explanatory.
I''m wondering if there''s any easy way to do this? Or do I
2006 Mar 22
9
render partial from withit mail template
Hi,
I''m trying to include a partial in an email template but it throws me this:
undefined method `controller_path'' for SupportMailer:Class
Extracted source (around line #12):
11:
12: <%= render :partial => ''footer'' %>
I guess email views are a little different from normal ones as they
don''t seem to have a access to a proper controller (?)
2006 Jan 10
0
auto_link generating error (nil.gsub) in functional test
Hi everyone,
When running tests, I get this error for running auto_link on a set of
column data:
test_list(PersonnelControllerTest):
ActionView::TemplateError: You have a nil object when you didn''t expect it!
The error occured while evaluating nil.gsub
On line #28 of app/views/personnel/list.rhtml
25: <tr valign="top" class="<%= alternate_rows