repost 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c76a83fdffd2e5c0bccf54354a4e0a4992dc74e319141866c50c09abf7e1633d
4
- data.tar.gz: e2a54d182d2e81e4ba21e2617ba74c98aa25fe1fb3524ed19dc35b43e128a86c
3
+ metadata.gz: 998c57594b27cb1c140eb6e141b2e64467a5cde407410c58bd3547f3529e7d20
4
+ data.tar.gz: d7fef86b10e728d49154e6883fdf53659bbbacd0f281283e6ff586f82cc67199
5
5
  SHA512:
6
- metadata.gz: 20f13dbf1823fed60b85eb7571d63a9ba3a15dbee0d3bb8908de84ebacb13f025a7af2dedf1ddf5bc570963aef6a61fc118dff6f0ef877a7cc9247c8cf367d71
7
- data.tar.gz: 88cb2230ff7e3fc75361924137e94462fd9812eb60408b9dbfecf8103fe99c111d0a02e158e967b1b69250e2b8e7c7d05472e259dfaf91262820ac13c24d4cb9
6
+ metadata.gz: 4ce51773149c3bb5afc481c415753a46e2136d2ef1e41aa17709028ec24682c95a44a913dddba3ea20c06a15bb201384478ab6cac42cb1f41eba97316d35e875
7
+ data.tar.gz: 97a6ab774d780fbe9cf238ee6172764adbc10d6dd6b0282f3c8950e967f413b560cb4852179d419c27d62dc1dd5ee542c66108864d90444902388a8c8235af64
@@ -39,12 +39,22 @@ module Repost
39
39
 
40
40
  def form_body
41
41
  inputs = params.map do |key, value|
42
- "<input type='hidden' name='#{key}' value='#{value}'>"
42
+ form_input(key, value)
43
43
  end
44
44
  inputs.unshift(csrf_token) if authenticity_token
45
45
  inputs.join
46
46
  end
47
47
 
48
+ def form_input(key, value)
49
+ if value.is_a?(Hash)
50
+ value.map do |inner_key, inner_value|
51
+ form_input("#{key}[#{inner_key}]", inner_value)
52
+ end.join
53
+ else
54
+ "<input type='hidden' name='#{key}' value='#{value}'>"
55
+ end
56
+ end
57
+
48
58
  def form_footer
49
59
  "</form>"
50
60
  end
@@ -1,3 +1,3 @@
1
1
  module Repost
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslavO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-03 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler