form_errors 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/form_errors/version.rb +1 -1
- data/lib/form_errors/view_helpers.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a5fd01c234220ad2a9ebfce3febd09612fb2a73
|
4
|
+
data.tar.gz: ff935a9ddaee7797c4cc2a3b4ebac75ee35326e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a70cb7fd1f901a2351e41928a8be078064e356b4044f220e56013d9b2482e57f624897616a8128fac5c03eb032a96adfb68d7e0b8503c39377b2d1e0b3f8008
|
7
|
+
data.tar.gz: 5ebc76532fd7c003159ef4c4f79e310b004adf27b0571d638233c66de05f280ded7028b429345d419dd2816e52fa63631bfb0c268e846c6459fd0eba54d6de98
|
data/README.md
CHANGED
@@ -65,6 +65,12 @@ The `h2` message defaults to:
|
|
65
65
|
"from being saved"
|
66
66
|
```
|
67
67
|
|
68
|
+
You can also pass html classes to the different DOM elements with:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
display_errors(@object, 'Whoopsie', error_string_class: 'h4')
|
72
|
+
```
|
73
|
+
|
68
74
|
## Contributing
|
69
75
|
|
70
76
|
1. Fork it ( http://github.com/johnotander/form_errors/fork )
|
data/lib/form_errors/version.rb
CHANGED
@@ -6,12 +6,12 @@ module FormErrors
|
|
6
6
|
<<-HTML
|
7
7
|
<div class="alert alert-danger alert-dismissable">
|
8
8
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
9
|
-
<h2 class="#{ html
|
9
|
+
<h2 class="#{ html[:error_string_class] }">
|
10
10
|
#{ get_error_string(error_string, object) }
|
11
11
|
</h2>
|
12
|
-
<ul class="#{ html
|
12
|
+
<ul class="#{ html[:error_list_class] }">
|
13
13
|
#{ object.errors.full_messages.map do |msg|
|
14
|
-
"<li class=\"#{ html
|
14
|
+
"<li class=\"#{ html[:error_list_item_class] }\">#{ msg }</li>"
|
15
15
|
end.join }
|
16
16
|
</ul>
|
17
17
|
</div>
|