flash-messenger 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0c66e2822f9909e4378b685105f345e61008482
4
- data.tar.gz: 151bb26cb6515143114804decca7a2baeecac8cf
3
+ metadata.gz: bcfd920b84f707bce9d2d51578983cebcf15c210
4
+ data.tar.gz: f0b39dd188271b89bade6d08d333b3efce49e5e6
5
5
  SHA512:
6
- metadata.gz: 8b7545dce58acc4f89dd44ee88685372bc56ee497f4d5b432748f17d47f97a9b5992b9f2011397505821692237666aeb2c6fbf081f52a4a31654ab3ecd6c172e
7
- data.tar.gz: c85764f309429ad1537a4055f00596713f6bb7dc61248ea8a634770e1da977281e034c8d1c858960adc7b0c0e3ea5f479f076852bdc23499e28053be77ba42c5
6
+ metadata.gz: 94bb6c964708591831ec07ecd49f57fb09237136d0b4cd742db199c9fca98c5df2ead173a132d58f9ea9c81c1ec83c42f03ba4bc8e6f396e7945349175197876
7
+ data.tar.gz: 49f4ed67bbbc73fe46bbae8d9eb3a2aef66c68b565dfc6d9b10d94ce52fd26579480300573b6489222c1a570175b770d56f56118aa981912ae93f0a8f3886b5e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.1.4 / 2016-05-07
2
+
3
+ Enabled I18n to flash_model_error
4
+
1
5
  # v0.1.3 / 2016-05-05
2
6
 
3
7
  Added all helpers to view
data/README.md CHANGED
@@ -32,7 +32,9 @@ Add the following to /app/assets/javascripts/application.js:
32
32
  ### Require CSS
33
33
  Add the following to /app/assets/stylesheets/application.css:
34
34
  ```
35
+ /*
35
36
  *= require flash-messenger
37
+ */
36
38
  ```
37
39
 
38
40
  ### Render
@@ -59,7 +61,7 @@ flash_error('Error!')
59
61
  ```
60
62
  You can also use it to show model errors:
61
63
  ```ruby
62
- flash_model_error(@model)
64
+ flash_model_error(model)
63
65
  ```
64
66
 
65
67
  ### Bootstrap
@@ -69,7 +71,9 @@ If you want to use bootstrap style, add the following to js file:
69
71
  ```
70
72
  Add the following to css file:
71
73
  ```
74
+ /*
72
75
  *= require flash-messenger-bootstrap
76
+ */
73
77
  ```
74
78
 
75
79
  ### Turboboost
@@ -15,15 +15,4 @@
15
15
  };
16
16
  $(document).on('ready page:load', show);
17
17
  };
18
-
19
- window.flash.modelError = function (errors, options) {
20
- options = options || {};
21
- options.type = 'error';
22
- for (var key in errors) {
23
- var messages = errors[key];
24
- messages.forEach(function (message) {
25
- flash(key + ' ' + message, options);
26
- });
27
- }
28
- };
29
18
  })(jQuery);
@@ -20,7 +20,9 @@ module FlashMessenger
20
20
 
21
21
  def flash_model_error(errors, options = nil)
22
22
  errors = errors.errors if errors.is_a? ActiveRecord::Base
23
- push_flash(errors.as_json, options, 'modelError')
23
+ errors.full_messages.to_a.each do |message|
24
+ push_flash(message, options, 'error')
25
+ end
24
26
  end
25
27
 
26
28
  def flash_messenger
@@ -1,3 +1,3 @@
1
1
  module FlashMessenger
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
4
+ version: 0.1.4
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-05 00:00:00.000000000 Z
11
+ date: 2016-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: request_store