search for: white_list

Displaying 9 results from an estimated 9 matches for "white_list".

Did you mean: whiltelist
2007 Mar 29
1
improving on: truncate(..) + rendered text ?
...runcate(..) would often cut in the middle of html tags => random result. My first idea was to "repair" the broken text with Hpricot (as I use it elsewhere in the project), but it''s not perfect: <h1>abcd</h would give <h1>abcd</h</h1> (I also use white_list to clean the <script>..) I guess there are only 2 alternatives: - a smart html_truncate(..) or - "unrender" the text (html => plain text) Has anybody explored those directions? TIA Alain Ravet. --~--~---------~--~----~------------~-------~--~----~ You received this messag...
2006 Sep 18
2
RedCloth !image! bug with filter_html
Hi all! I am trying tu set up RedCloth for user-submitted comments. And here is my problem. The :filter_html option just breaks images :-( For example, if I try in irb: string= "Some textile !agif.gif! and textile again" RedCloth.new(string, [:filter_html, :filter_styles]).to_html(:textile) I get: NoMethodError: You have a nil object when you didn''t expect it! The error
2011 Jan 15
3
respond_with javascript
...nView::MissingTemplate (Missing template votes/new with {:locale=>[:en, :en], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml, :haml], :formats=>[:html]} in view paths "/Users/snibble/Projects/Ruby/storychan/app/views", "/ Users/snibble/Projects/Ruby/storychan/vendor/plugins/white_list/app/ views"): app/controllers/votes_controller.rb:16:in `create'' Rendered /opt/local/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/ action_dispatch/middleware/templates/rescues/missing_template.erb within rescues/layout (1.0ms) The votes controller only has the create option: de...
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 impact of HTML or JS
2008 Jan 15
0
Problem with ruby-debug and rspec
...ough to a method_missing. I''m kind of stumped on this one... any ideas? -rabble I''ve got the following plugins installed: active_record_base_without_table annotate_models asset_packager exception_logger fixture_replacement query_reviewer rspec rspec_on_rails spatial_adapter svn white_list will_paginate ym4r_gm and am using the following gems: GeoRuby-1.3.2 RedCloth-3.0.4 has_finder-0.1.5 json-1.1.1 mocha-0.5.5 oauth ruby-hmac-0.3.1 brickhouse:~/code/fireeagle-rails/core/trunk rabble$ spec spec/controllers/account_controller_spec.rb /Users/rabble/code/fireeagle-rails/core/trunk/lib...
2008 Feb 01
4
How to sanitize _before_ going into the database?
I use a call to the sanitize method every time I render some user input, but it would be much nicer if I could clean it up once before putting it into the database and avoid having to call the (relatively expensive) sanitize every time I render a page. My first thought was to just add something like: def message=(x) self[:message]=sanitize(x) end However, the sanitize helper cannot be called
2006 Sep 26
12
resource_feeder feedback
Let me apologize in advance as this is a topic that I feel passionate and opinionated about. If I''m coming on too strong, please forgive me. === Be opinionated=== My first piece of advice is simple: be opinionated. Change the method name to simply <feed_for>. Have it default to doing the right thing. Perhaps give an option to change the default feed format, but default to
2012 Jan 25
4
serializable_hash and serializable_add_includes
I''m trying to write a helper method similar to attr_accessible but instead it will be used to whitelist which attributes are available for serialization (attr_serializable). My first attempt at this was to override serialized_hash and modify the :only option to include nothing but serializable attributes. I''m facing a problem when nested models are ''included''
2007 Mar 06
59
Memory leaks in my site
Hi all, My environment is ruby-1.8.4, rails 1.2.2, mongrel 1.0.1, linux 2.6. Now, i have a problem on memory leaks with mongrel. My site is running 5 mongrel processes on a 2G RAM machine, the memory of each process grows from about 20M to about 250M, but it never recover to the initial 20M, so i had to restart the mongrel processes once per day. The load is about 1M hits per day. Waiting for