bootstrap_concerns 0.1.8 → 0.2.1

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: e64bd154f92aa9e3c769f9f57374d25c49a96f3b8cc1907f613b4ec5242eee9b
4
- data.tar.gz: 273b3b714feb668ca78ea5a0624f3c18d3f9c8305fb41a2e3963df658a4344c5
3
+ metadata.gz: 99f4511fc0861281629f55dae1b05c84c7cf553d1c7cb03b21f83d827b63c880
4
+ data.tar.gz: 056c22d774924958e1e18bf4a7cb0185773ccee33484d972a84e2afb41ce4dca
5
5
  SHA512:
6
- metadata.gz: ea3e846855b8d90517655ba9d4ba1b4b11587b4e25add9d41f493496f22c017dd43d49625a8815cd8375a70e4c60c4f677f7709c24fdf076091f2a06c414e62a
7
- data.tar.gz: '07528556f386a44eef6b9bcb72a3f2c73f2d177148b3d2b22452df4574e48368f1ef84ae559951b96bd9195ccebe0be0bb0154e7373c498993873d352cf4e13e'
6
+ metadata.gz: 814eb8701b5e76bd5a8a09997fb4bb3d9e2c453ca1788c2c7f291db27c622f405c2a6ed170d0ae738e0867bb3b61975e4816b0afa9951023dc386011de568d18
7
+ data.tar.gz: 4ade431c1d26f6c9d8a4f10c7e4c36456396a66fb7a91e238f7249042ed258f72056a6dcc96b972328b94e699f44945cce10313a0b27780e81ee89b14ac35786
@@ -18,6 +18,22 @@ module BootstrapConcerns
18
18
  bs_link_or_button_to(:button_to, name, options, html_options, &)
19
19
  end
20
20
 
21
+ def bs_errors(record)
22
+ return if record.errors.empty?
23
+
24
+ content_tag(:div, class: "alert alert-danger alert-dismissible fade show mt-3") do
25
+ concat content_tag(:h5, "Errors")
26
+ concat(
27
+ content_tag(:ul, class: "mb-0") do
28
+ record.errors.full_messages.each do |message|
29
+ concat content_tag(:li, message)
30
+ end
31
+ end
32
+ )
33
+ concat content_tag(:button, nil, type: "button", class: "btn-close", data: {bs_dismiss: "alert"})
34
+ end
35
+ end
36
+
21
37
  def bs_link_or_button_to(method_name, name, options, html_options, &)
22
38
  normalized_html_options =
23
39
  if block_given?
@@ -102,7 +118,7 @@ module BootstrapConcerns
102
118
 
103
119
  def bs_table(&)
104
120
  content_tag :div, class: "table-responsive" do
105
- content_tag(:table, class: "table table-striped table-sm", &)
121
+ content_tag(:table, class: "table table-striped table-sm align-middle", &)
106
122
  end
107
123
  end
108
124
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_concerns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Brooks
8
8
  - Robert Keresnyei
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-14 00:00:00.000000000 Z
11
+ date: 2025-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview