flash-messenger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/flash-messenger/engine.rb +1 -1
- data/lib/flash-messenger/helper.rb +23 -0
- data/lib/flash-messenger/version.rb +1 -1
- data/lib/flash-messenger/view_helper.rb +2 -0
- data/lib/flash-messenger.rb +0 -3
- metadata +2 -3
- data/lib/flash-messenger/controller_helper.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0c66e2822f9909e4378b685105f345e61008482
|
4
|
+
data.tar.gz: 151bb26cb6515143114804decca7a2baeecac8cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b7545dce58acc4f89dd44ee88685372bc56ee497f4d5b432748f17d47f97a9b5992b9f2011397505821692237666aeb2c6fbf081f52a4a31654ab3ecd6c172e
|
7
|
+
data.tar.gz: c85764f309429ad1537a4055f00596713f6bb7dc61248ea8a634770e1da977281e034c8d1c858960adc7b0c0e3ea5f479f076852bdc23499e28053be77ba42c5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
|
+
require "request_store"
|
2
|
+
|
1
3
|
module FlashMessenger
|
2
4
|
module Helper
|
5
|
+
def flash_message(message, options = nil)
|
6
|
+
push_flash(message, options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def flash_notice(message, options = nil)
|
10
|
+
push_flash(message, options, 'notice')
|
11
|
+
end
|
12
|
+
|
13
|
+
def flash_alert(message, options = nil)
|
14
|
+
push_flash(message, options, 'alert')
|
15
|
+
end
|
16
|
+
|
17
|
+
def flash_error(message, options = nil)
|
18
|
+
push_flash(message, options, 'error')
|
19
|
+
end
|
20
|
+
|
21
|
+
def flash_model_error(errors, options = nil)
|
22
|
+
errors = errors.errors if errors.is_a? ActiveRecord::Base
|
23
|
+
push_flash(errors.as_json, options, 'modelError')
|
24
|
+
end
|
25
|
+
|
3
26
|
def flash_messenger
|
4
27
|
RequestStore.store[:flash_messenger] ||= []
|
5
28
|
end
|
data/lib/flash-messenger.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flash-messenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chen, Yi-Cyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: request_store
|
@@ -175,7 +175,6 @@ files:
|
|
175
175
|
- bin/setup
|
176
176
|
- flash-messenger.gemspec
|
177
177
|
- lib/flash-messenger.rb
|
178
|
-
- lib/flash-messenger/controller_helper.rb
|
179
178
|
- lib/flash-messenger/engine.rb
|
180
179
|
- lib/flash-messenger/helper.rb
|
181
180
|
- lib/flash-messenger/version.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module FlashMessenger
|
2
|
-
module ControllerHelper
|
3
|
-
include FlashMessenger::Helper
|
4
|
-
|
5
|
-
def flash_message(message, options = nil)
|
6
|
-
push_flash(message, options)
|
7
|
-
end
|
8
|
-
|
9
|
-
def flash_notice(message, options = nil)
|
10
|
-
push_flash(message, options, 'notice')
|
11
|
-
end
|
12
|
-
|
13
|
-
def flash_alert(message, options = nil)
|
14
|
-
push_flash(message, options, 'alert')
|
15
|
-
end
|
16
|
-
|
17
|
-
def flash_error(message, options = nil)
|
18
|
-
push_flash(message, options, 'error')
|
19
|
-
end
|
20
|
-
|
21
|
-
def flash_model_error(errors, options = nil)
|
22
|
-
errors = errors.errors if errors.is_a? ActiveRecord::Base
|
23
|
-
push_flash(errors.as_json, options, 'modelError')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|