Displaying 20 results from an estimated 40000 matches similar to: "reverse of simple_format?"
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 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,
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 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
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 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
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
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 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 Jan 09
3
XSS prevention with Rails
Hi!
I wanna take a stab at implementing better XSS prevention for Rails.
This time for real =)
I''m wondering what would be the better way, clean everything up with
tidy first and then do the rest with regexp or regexp all the way?
Anybody done this before?
Thanks!
Ciao!
Florian
2005 Dec 28
0
Modifying VERBOTEN_TAGS in TextHelper
Hello all,
I''m using the sanitize() method from TextHelper in my application, which
appears to use the VERBOTEN_TAGS constant to define which tags to escape
out from the HTML. I''d like to modify VERBOTEN_TAGS to include some more
tags, but I''m not sure where I would place the necessary code in my
rails app. Any ideas?
Thanks,
Kamil
--
Posted via
2006 May 15
1
Simple: How to use TextHelper in a controller
I''m having trouble succesfully getting access to the
ActionView::Helpers::TextHelper.strip_tags
method from one of my controllers.
If I try to call it directly using
ActionView::Helpers::TextHelper.strip_tags
I get
undefined method `strip_tags'' for ActionView::Helpers::TextHelper:Module
What is the preferred way to make ActionView helpers available to a
descendant of
1999 Sep 30
0
SMBTAR Not Backing up Files
I am having trouble getting SMBTAR to do a complete backup on NT
Workstation and NT Server. The backup starts off just fine. However,
after a short time, errors begin showing up and files are not backed
up. The files that are missed are not open files. I have set the -t
option to disk and tape. I get pretty much the same result. Both NT
machines have over 2 GB of data to backup up. I am
2012 Feb 17
0
HtmlSlicer 0.0.1
How to split HTML content?
Well, the text like:
<p>Ruby on Rails is a next-generation web-framework<br><b>YEAH!</b>And of course Java killer?! :) ©</p>
You can split to a pages in a smart way.
I tried to realize it in a gem for my internal use, and now when it works for my Rails 3.1.3 application, this is enough to make it public.
I
2006 Mar 15
4
RJS template eating encoding
I was previously doing an update via .rhtml templates creating an AJAX
:evaluate_remote_response. I use UTF-8 in my pages, and my app
requires that I be 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:
<%=
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/.
2009 Apr 22
1
reversing xlim, ylim in smoothScatter
Hello,
I have found that in smoothScatter it is not possible to reverse the axes plotted (R version 2.9.0) . It appears that this arises from the hard coding of xlim and ylim in smoothscatter.R in the lines :
x <- x[ xlim[1] <= x[,1] & x[,1] <=xlim[2], ] (line number 25)
and
x <- x[ ylim[1] <= x[,2] & x[,2] <= ylim[2], ] (line number 31)
This results in a x
2002 Aug 12
0
secrets file, reverse resolution problems
Hi. (once more)
After setting up rsync as daemon, i would like to point out 2 problems
I have a single user name in my secrets file, and if i do not provide an
empty line after that username, rsync won't authenticate the user for me.
only if i put a blank line after the username. This is a problem i spent too
much time figuring out and didn't find it mentioned in the list or man page,
2009 Jan 06
1
How to access text helper and url helper methods in model
Hi,
I want to access TextHelper and UrlHelper methods in my model so how i
am able to access it ?
I was included following helper in my model but still it is not
working? also for accessing these helper method w need to give external
reference?
E.g.
class Xyz
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
Also
2008 Sep 18
8
handling association changes? What's the best practice?
Hello all!
I have a conundrum that I''m _sure_ someone else has already thought of
and solved. How does one best handle the scenario of association
object changes and data integrity?
For example, if I have a standard ecommerce site that sells Products
and people can have Orders and an Order has_many Products... then,
what happens if Product #3 is part of Order #2 but at some point, the