petergate 1.7.5 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +1 -0
- data/README.md +53 -0
- data/lib/petergate/active_record/base.rb +2 -0
- data/lib/petergate/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e3e7f6b21e4e2741e2f6532608aa4d474d3b06c
|
4
|
+
data.tar.gz: bc189e9b546e61b2f4286ed926ca215154a98d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28a273b2501a589505919929ff370547865f5404ca39f99bb1f21632c0ba51b679e3fe0043684143737a925852cddef3634ff387c49f574a4cdc5980282cc529
|
7
|
+
data.tar.gz: 6476a7d81f6f4669fbc50f4134bd7095adca0549ee293e38e1b73b08fc32610a69cdcd530f3817c2991f3c5d5549e260296e3512a874ad7d0e887961c7dcaaf1
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -119,6 +119,59 @@ If you want to change the `permission denied` message you can add to the access
|
|
119
119
|
access user: [:show, :index], message: "You shall not pass"
|
120
120
|
```
|
121
121
|
|
122
|
+
#### User Admin Example Form for Multiple Roles
|
123
|
+
|
124
|
+
```slim
|
125
|
+
= form_for @user do |f|
|
126
|
+
- if @user.errors.any?
|
127
|
+
#error_explanation
|
128
|
+
h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
|
129
|
+
ul
|
130
|
+
- @user.errors.full_messages.each do |message|
|
131
|
+
li = message
|
132
|
+
|
133
|
+
.field
|
134
|
+
= f.label :email
|
135
|
+
= f.text_field :email
|
136
|
+
- if @user.new_record? || params[:passwd]
|
137
|
+
.field
|
138
|
+
= f.label :password
|
139
|
+
= f.text_field :password
|
140
|
+
.field
|
141
|
+
= f.label :password_confirmation
|
142
|
+
= f.text_field :password_confirmation
|
143
|
+
.field
|
144
|
+
= f.label :roles
|
145
|
+
= f.select :roles, @user.available_roles, {}, {multiple: true}
|
146
|
+
.actions = f.submit
|
147
|
+
```
|
148
|
+
|
149
|
+
#### User Admin Example Form for Single Role Mode
|
150
|
+
|
151
|
+
```slim
|
152
|
+
= form_for @user do |f|
|
153
|
+
- if @user.errors.any?
|
154
|
+
#error_explanation
|
155
|
+
h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
|
156
|
+
ul
|
157
|
+
- @user.errors.full_messages.each do |message|
|
158
|
+
li = message
|
159
|
+
|
160
|
+
.field
|
161
|
+
= f.label :email
|
162
|
+
= f.text_field :email
|
163
|
+
- if @user.new_record? || params[:passwd]
|
164
|
+
.field
|
165
|
+
= f.label :password
|
166
|
+
= f.text_field :password
|
167
|
+
.field
|
168
|
+
= f.label :password_confirmation
|
169
|
+
= f.text_field :password_confirmation
|
170
|
+
.field
|
171
|
+
= f.label :role
|
172
|
+
= f.select :role, @user.available_roles
|
173
|
+
.actions = f.submit
|
174
|
+
```
|
122
175
|
Credits
|
123
176
|
-------
|
124
177
|
|
data/lib/petergate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petergate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Sloan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -62,6 +62,7 @@ extensions: []
|
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
64
|
- ".gitignore"
|
65
|
+
- ".ruby-version"
|
65
66
|
- ".travis.yml"
|
66
67
|
- Gemfile
|
67
68
|
- LICENSE.txt
|