any_login_multiple 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/app/views/any_login_multiple/_any_login_multiple.html.erb +9 -5
- data/config/routes.rb +1 -1
- data/lib/any_login_multiple/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f84a69de66f20bc3b6bbfa23a5ee64a9682c15dc9e743bf64dee6f20d89ff29
|
4
|
+
data.tar.gz: 45bf301b4176fcbd4436abc4d38198c6a821aee7750bc638721a86f7759e292c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa1080dc04a2910432f691a423dc813983139a598a2089adbd3001eb66b7ae14ba79249f13223e5470891dc0a77732a2163950dc47e7615e5f2a665a0746c4ba
|
7
|
+
data.tar.gz: 5fa5a009a4af1a332d6bc62f30827e3e00bf3d4e2346a041df459bbd5ce5623fcd8826a4df2692f160cdc79c16acecb81f16568504c38c692ce19ffc7d083f8b
|
data/README.md
CHANGED
@@ -3,15 +3,17 @@
|
|
3
3
|
This gem is inspired by [any_login](https://github.com/igorkasyanchuk/any_login).
|
4
4
|
This gem supports multiple models.
|
5
5
|
|
6
|
+

|
7
|
+
|
6
8
|
## Installation
|
7
9
|
|
8
|
-
First of all, this gem only work in an environment
|
9
|
-
where [devise](https://github.com/heartcombo/devise) is installed
|
10
|
+
**First of all, this gem only work in an environment
|
11
|
+
where [devise](https://github.com/heartcombo/devise) is installed.**
|
10
12
|
|
11
13
|
Add this line to your application's Gemfile:
|
12
14
|
|
13
15
|
```ruby
|
14
|
-
group :development do
|
16
|
+
group :development, :test do
|
15
17
|
gem 'any_login_multiple'
|
16
18
|
end
|
17
19
|
```
|
@@ -21,6 +23,12 @@ And then execute:
|
|
21
23
|
$ bundle install
|
22
24
|
```
|
23
25
|
|
26
|
+
Add this line to `routes.rb`:
|
27
|
+
|
28
|
+
```rb
|
29
|
+
mount AnyLoginMultiple::Engine => '/any_login_multiple' if Rails.env.development?
|
30
|
+
```
|
31
|
+
|
24
32
|
Add `config/initializers/any_login_multiple.rb` and set `klass_names`:
|
25
33
|
|
26
34
|
```rb
|
@@ -2,12 +2,11 @@
|
|
2
2
|
<a class="any-login-multiple-trigger">Display Form</a>
|
3
3
|
<div class="any-login-multiple-forms-container" style='display: none;'>
|
4
4
|
<% AnyLoginMultiple.klass_names.each do |klass_name| %>
|
5
|
-
<%= form_with url: any_login_multiple.
|
5
|
+
<%= form_with url: any_login_multiple.any_login_multiple_sign_in_path(as: klass_name), class: 'any-login-multiple-form', method: :post do |form| %>
|
6
6
|
<label>
|
7
7
|
<%= klass_name %>
|
8
8
|
</label>
|
9
|
-
<%= form.select :id, klass_name.constantize.pluck(:email, :id) %>
|
10
|
-
<%= form.submit 'Submit' %>
|
9
|
+
<%= form.select :id, klass_name.constantize.pluck(:email, :id), include_blank: "Select #{klass_name}" %>
|
11
10
|
<% end %>
|
12
11
|
<% end %>
|
13
12
|
</div>
|
@@ -19,9 +18,14 @@
|
|
19
18
|
bottom: 0;
|
20
19
|
left: 0;
|
21
20
|
background: #5c4383;
|
22
|
-
color: white;
|
23
21
|
z-index: 100;
|
24
|
-
padding: 5px
|
22
|
+
padding: 10px 5px;
|
23
|
+
}
|
24
|
+
.any-login-multiple-wrapper a, label {
|
25
|
+
color: white;
|
26
|
+
}
|
27
|
+
.any-login-multiple-form {
|
28
|
+
margin: 10px 0;
|
25
29
|
}
|
26
30
|
.any-login-multiple-trigger {
|
27
31
|
color: white;
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: any_login_multiple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kenzo-tanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|