nagybence-railhead_sanitize 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -7
- data/init.rb +1 -1
- data/lib/railhead_sanitize.rb +1 -1
- data/railhead_sanitize.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
=
|
1
|
+
= RailheadSanitize
|
2
2
|
|
3
|
-
|
3
|
+
RailheadSanitize is a Ruby on Rails plugin that automatically strips tags from input fields.
|
4
4
|
|
5
5
|
== Installation
|
6
6
|
|
7
7
|
Installation is available as gem (recommended):
|
8
8
|
|
9
|
-
config.gem
|
9
|
+
config.gem 'nagybence-railhead_sanitize', :lib => 'railhead_sanitize', :source => 'http://gems.github.com'
|
10
10
|
|
11
11
|
Or as Rails plugin:
|
12
12
|
|
13
|
-
$ ruby script/plugin install git://github.com/nagybence/
|
13
|
+
$ ruby script/plugin install git://github.com/nagybence/railhead_sanitize.git
|
14
14
|
|
15
15
|
== Usage
|
16
16
|
|
@@ -18,12 +18,12 @@ It works fully automatically, but there are two options to modify the default be
|
|
18
18
|
|
19
19
|
Does not strip a parameter:
|
20
20
|
|
21
|
-
|
21
|
+
auto_sanitize :except => [:title]
|
22
22
|
|
23
23
|
Uses 'sanitize' instead of 'strip_tags':
|
24
24
|
|
25
|
-
|
25
|
+
auto_sanitize :allow_tags => [:body]
|
26
26
|
|
27
27
|
== License
|
28
28
|
|
29
|
-
Copyright (c) 2008 Bence Nagy (nagybence@tipogral.hu), released under the MIT license.
|
29
|
+
Copyright (c) 2008-2009 Bence Nagy (nagybence@tipogral.hu), released under the MIT license.
|
data/init.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require '
|
1
|
+
require 'railhead_sanitize'
|
data/lib/railhead_sanitize.rb
CHANGED
@@ -20,7 +20,7 @@ module RailheadSanitize
|
|
20
20
|
|
21
21
|
def sanitize_fields
|
22
22
|
self.class.columns.each do |column|
|
23
|
-
next unless
|
23
|
+
next unless column.type == :string or column.type == :text
|
24
24
|
field = column.name.to_sym
|
25
25
|
value = self[field] && self[field].strip
|
26
26
|
if sanitize_options && sanitize_options[:except].include?(field)
|
data/railhead_sanitize.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "railhead_sanitize"
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.1"
|
4
4
|
s.date = "2009-01-27"
|
5
5
|
s.summary = "RailheadSanitize is a Ruby on Rails plugin that automatically strips tags from input fields."
|
6
6
|
s.email = "nagybence@tipogral.hu"
|