flash_rails_messages 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flash_rails_messages/base.rb +12 -4
- data/lib/flash_rails_messages/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50dcc71888ef680be0e9596e6ffdc4009288abe1a9f9112e67de48a261e0512b
|
4
|
+
data.tar.gz: cb30d724c044b9ccdb90409bc0885eef49ea9f65c4507cf7195393ec9364d0f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1f08a2b0048cc522d363a2cce87da735a6a38225faa004000734265ce9d75376238ba2528dbbf768fa03afc20a46bee392a2ff3aa91f7888fb3d97d9f3c635
|
7
|
+
data.tar.gz: 8d04a2aceb162909dad3e1f55312c093c1536a2500ddf30f309cea66ed5038951150c9dbc1b4861d363c6deed1a32d4c25dc3828e5522a4a9a21aef4bd6f52c9
|
@@ -10,13 +10,22 @@ module FlashRailsMessages
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def render(flash)
|
13
|
-
flash
|
14
|
-
|
13
|
+
messages(flash).map do |message|
|
14
|
+
alert_element(*message)
|
15
|
+
end.join.html_safe
|
15
16
|
end
|
16
17
|
|
17
18
|
private
|
18
19
|
|
20
|
+
def messages(flash)
|
21
|
+
Hash[flash]
|
22
|
+
.symbolize_keys
|
23
|
+
.keep_if { |key, _| alert_type_classes.include?(key) }
|
24
|
+
end
|
25
|
+
|
19
26
|
def alert_element(type, message)
|
27
|
+
return unless message.respond_to?(:html_safe)
|
28
|
+
|
20
29
|
content_tag :div, alert_options(type) do
|
21
30
|
content = ActiveSupport::SafeBuffer.new
|
22
31
|
content += close_element if options.fetch(:dismissible, false)
|
@@ -58,7 +67,6 @@ module FlashRailsMessages
|
|
58
67
|
{}
|
59
68
|
end
|
60
69
|
|
61
|
-
def custom_alert_classes
|
62
|
-
end
|
70
|
+
def custom_alert_classes; end
|
63
71
|
end
|
64
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flash_rails_messages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Gutiérrez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.2.
|
152
|
+
rubygems_version: 3.2.32
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: This gems provides an easy way to display flash rails messages
|