check_tag 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module CheckTag
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/check_tag.rb CHANGED
@@ -2,7 +2,8 @@ require "check_tag/version"
2
2
  include ActionView::Helpers::FormTagHelper
3
3
 
4
4
  module CheckTag
5
- def self.now(id, check=nil, uncheck=nil, defaulted=nil)
5
+
6
+ def check_tag(id, check=nil, uncheck=nil, defaulted=nil)
6
7
  begin
7
8
  @id = id
8
9
  @check = check
@@ -13,12 +14,12 @@ module CheckTag
13
14
  hidden_tag = hidden_field_tag(@id, @uncheck)
14
15
  return_objects = check_box_tag(@id, @check, (@defaulted == @check ? true : false))
15
16
  return hidden_tag + " " + return_objects
16
- rescue
17
- puts "CHECK TAG ERROR. You may have not have used all four arguments. Usage: CheckTag.now('test_id', 'yes', 'no', 'no')"
17
+ rescue Exception => exc
18
+ puts "CHECK TAG ERROR.........#{exc}"
18
19
  end
19
20
  end
20
21
 
21
- def self.defaults
22
+ def defaults
22
23
  if !@check
23
24
  @check = 'true'
24
25
  end
@@ -30,7 +31,7 @@ module CheckTag
30
31
  end
31
32
  end
32
33
 
33
- def self.string_now
34
+ def string_now
34
35
  @id = @id.to_s
35
36
  @check = @check.to_s
36
37
  @uncheck = @uncheck.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-08 00:00:00.000000000 -04:00
12
+ date: 2012-04-09 00:00:00.000000000 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: Check box tag that submits value whether checked or unchecked