paysio 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/paysio/form.rb +8 -4
- data/lib/paysio/version.rb +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.10
|
data/lib/paysio/form.rb
CHANGED
@@ -3,7 +3,7 @@ module Paysio
|
|
3
3
|
attr_accessor :params, :values, :errors, :html_options
|
4
4
|
|
5
5
|
def initialize(params = {})
|
6
|
-
@params =
|
6
|
+
@params = params
|
7
7
|
@values = {}
|
8
8
|
@errors = {}
|
9
9
|
@html_options = {}
|
@@ -29,14 +29,18 @@ module Paysio
|
|
29
29
|
|
30
30
|
def render_html
|
31
31
|
html = <<-TEXT
|
32
|
-
<form id="#{
|
32
|
+
<form id="#{html_options[:id] || 'paysio'}"
|
33
|
+
class="#{html_options[:class]}"
|
34
|
+
action="#{html_options[:action] || '#'}"
|
35
|
+
method="#{(html_options[:method] || 'post').upcase}"
|
36
|
+
></form>
|
33
37
|
TEXT
|
34
38
|
end
|
35
39
|
|
36
40
|
private
|
37
41
|
def javascript_form_params
|
38
|
-
params_html = "$('##{
|
39
|
-
params_html << ", #{
|
42
|
+
params_html = "$('##{html_options[:id] || 'paysio'}'), #{params.to_json}, #{values.to_json}"
|
43
|
+
params_html << ", #{errors.to_json}" if errors.present?
|
40
44
|
params_html
|
41
45
|
end
|
42
46
|
end
|
data/lib/paysio/version.rb
CHANGED