Displaying 20 results from an estimated 57 matches for "texthelper".
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 o...
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 Mar 01
0
TextHelpers in Controller?
...guess it''s not kosher to use
viewer code, and Rails doesn''t let me. (Some interesting discussions
back from January 05 in the mail archives). I see lots of examples of
how to use helper :my_helper in a controller, with MY own generated
helpers, but how can I use the core API TextHelper suite?
err... and is there an opposite to simple_format, that converts <br>s
into line returns? regex would be simple enough of course, but if
somebody already wrote it into the API... (Yes, I did check the API as
far as I could).
TIA,
Micah
--
Posted via http://www.ruby-forum.com/.
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...
2009 Sep 14
0
markdown call prompts "uninitialized constant ActionView::Helpers::TextHelper::Markdown" in upgraded application
Hey All,
I''m attempting to upgrade my app from rails 2.0.2 to 2.3.3. One bit that''s failing is this call here (in /views/projects/show.html.erb)
<%= markdown(@project.description) %>
That earns me a:
uninitialized constant ActionView::Helpers::TextHelper::Markdown
On that line.
I''m on a rebuilt machine (windows xp, ruby 1.8.6) so I thought it was a missing bluecloth gem, but I think I fixed that (bc works in irb at least).
What would be good to diagnose & fix this problem?
Many thanks!
-Roy
GHC Confidentiality Statement
This mes...
2006 May 16
3
Best way to handle namespace collisions?
All,
I have a little namespace collision here. I am trying to use both
RubyfulSoup (an HTML parser - which I highly recommend by the way) and
the ActionView::Helpers::TextHelper class. Within the TextHelper class,
there''s an attempt to create a new "Tag" object. However, Tag is also
defined in the RubyfulSoup gem and it is _this_ Tag class whose
initialize method is being called (and failing of course).
So, is my choice simply which Gem to hack and...
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::TextHelpe...
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
2009 Jan 01
2
Ruby on rails API website suggestion
...request a feature.. like: http://rubyonrails.org/function
and it
will search inside http://api.rubyonrails.org for the function and
show it.
Like PHP has.. http://php.net/basename
Example: http://rubyonrails.org/truncate and it will points to
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001541
That woul be cool.
Thanks
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane....
2009 Jan 01
2
Ruby on rails API website suggestion
...request a feature.. like: http://rubyonrails.org/function
and it
will search inside http://api.rubyonrails.org for the function and
show it.
Like PHP has.. http://php.net/basename
Example: http://rubyonrails.org/truncate and it will points to
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001541
That woul be cool.
Thanks
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane....
2006 Feb 25
7
Help with DRY: too much code in my view
I''m a newbie to rails, and really to the whole DRY and MVC thing as
well, except where I accidentally fell into things doing it my own way
in the past.
I''ve got a fairly complex DB structure I want to create an interface for
using Rails. Getting simple tables to display, edit, save, not too much
problem there. But where I''m having trouble is figuring out where 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.
2006 Feb 20
2
Alternating Table Row Colors
Does Rails have built in support for alternating table row colors?
Thanks,
Sam
2011 Apr 19
1
RSpec/Webrat Checking output is properly escaped
...from a create action is
sanitized properly, but rspec or webrat appears to be parsing the
output into proper HTML chars instead of escaped characters. I have
verified that it escapes properly in the regular browser json
response.
The relevant RSpec test code is:
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
it "should automatically sanitize any HTML or script characters"
do
post :create, :post_id => @post.id,
:content => "<h1>Oh Hai!</h1><script>",
:user_id => @u...
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.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5694-change-truncate-example-in-auto_link-docs-to-correc...
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.
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 May 02
6
Is there a link_to ''external url''?
I''ve checked the Rails documentation but find no mention of link_to
''external url'' or equivalent. Does rails have a built in method to do
this?
thanks
-Lindsay
--
Posted via http://www.ruby-forum.com/.
2009 Feb 24
2
Displaying line breaks & paragraphs using 'simple_format' ?
...lah 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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~--...
2007 Nov 29
27
Strip & Sanitize BEFORE saving data
So I''ve googled my brains out, and I see a lot of talk about
TextHelper for views, but next to no discussion about cleaning text
_before_ it is saved.
I figured this had to be asked 4 zillion times, but I''m not finding
anything concrete/obvious.
Using h is fine as a safety catch, but that alone is not acceptable
to me as the means of diffusing the impa...