asbru 0.0.15 → 0.0.16

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebf12b69b01b62d6dcbc52649220873833aee8f9f9e5fa02d7ebfc568612b3ca
4
- data.tar.gz: dfb5e1c9e02f4943c2f6e8a187c00b105756b08e64e60531a35307907618b227
3
+ metadata.gz: f1e59ef0d7603903d9130fb26f9acc5a259952269b809107185fa3e9881fe50c
4
+ data.tar.gz: 7425e9dfcbbc67bf3244caa1f3ca54d13a42e4a979095086ad2aa0de5b9bd49a
5
5
  SHA512:
6
- metadata.gz: 36e7a3e6eb29ed8978569190fc086cafd983ced9e3669c77f8e1b4b4d3e9470f9634441bea50f8112cf37b050d9cf3054e47210dcd4ddf41a7d5ff6d4fecace1
7
- data.tar.gz: 682f6f031a738b95d31083d27ba11669b8dfdb161697d71bd67c14c5497d132d6d32724f43039c2213a01f395edc6d2e5d4058299f459e888b4198dbf1726f87
6
+ metadata.gz: a8ab96f575317dc637da675b91d01dc25aaf39b8bb9d7b10b4dc04e62e8f5bd642facc98c484a289e248ff4727eed00fd777874bec86a604ab047748d39a3fd1
7
+ data.tar.gz: fb4fa46f0ceb53590f6229439bc9b8f55e9c51c13eaf496e8853cabddb85d03907a3d37efac6ef46af7a9397cd3ad4be26fe2153fa408f19963a8499c909ae52
@@ -27,7 +27,6 @@ module Asbru
27
27
  end
28
28
 
29
29
  BASIC_FORM_FIELDS = [
30
- { submit: { text: 'Submit', type: 'submit' } },
31
30
  { date_field: { type: 'datepicker' } },
32
31
  { password_field: { type: 'password' } },
33
32
  { text_area: { type: 'textarea' } },
@@ -121,10 +120,29 @@ module Asbru
121
120
  end
122
121
  end
123
122
 
124
- # def submit(attribute = nil, options = {})
125
- # render_form_element attribute,
126
- # options.reverse_merge(text: 'Submit', type: 'submit')
127
- # end
123
+ def submit(attribute = nil,
124
+ text: 'Submit',
125
+ type: 'submit',
126
+ **options)
127
+ options[:text] = text
128
+ options[:type] = type
129
+ options[:customData] = {} if options[:customData].nil?
130
+
131
+ if options.dig(:customData, :'data-disable').nil?
132
+ Rails.application
133
+ .config.action_view
134
+ .automatically_disable_submit_tag
135
+ .tap do |disable|
136
+ if disable == false
137
+ options[:customData][:'data-disable'] = false
138
+ else
139
+ options[:customData][:'data-disable'] = true
140
+ end
141
+ end
142
+ end
143
+
144
+ render_form_element attribute, options
145
+ end
128
146
 
129
147
  # def date_field(attribute = nil, options = {})
130
148
  # render_form_element attribute,
data/lib/asbru/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Asbru
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asbru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stev-0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2022-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.3.7
111
+ rubygems_version: 3.2.15
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Asbru is a tool for creating component based webpages.