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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2feaa077f84418f69e2ca884beb0a2590aa038419a4690c4428f1780690b5ca9
4
- data.tar.gz: fb498fc5a2666ed6f529347a9f3e0e814eb34e5ca3995553a0740dc90522f78b
3
+ metadata.gz: 1f84a69de66f20bc3b6bbfa23a5ee64a9682c15dc9e743bf64dee6f20d89ff29
4
+ data.tar.gz: 45bf301b4176fcbd4436abc4d38198c6a821aee7750bc638721a86f7759e292c
5
5
  SHA512:
6
- metadata.gz: 9117233bcfb3006df026deb167f6eeadcbebeb113f98d7798207e842ffc68a79410e75894ff56d8003c5c33c9c59a8f9180f71ccd9e6a3dfc45dbd554f7713ec
7
- data.tar.gz: b25c84050e5a5a0defb7368f144a14ea2692db38b9c9cbc00f1b7a8fb14349b68fa53c484688fd952675e627c341aeadc5bf4f5b4a88ba046be7ba3576ee290c
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
+ ![any-login-multiple-demo-v2](https://user-images.githubusercontent.com/33926355/130531912-5332fd94-078d-4d91-bdda-9f92bbe9da39.gif)
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.sign_in_path(as: klass_name), class: 'any-login-multiple-form', method: :post do |form| %>
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 10px;
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
@@ -1,3 +1,3 @@
1
1
  AnyLoginMultiple::Engine.routes.draw do
2
- post '/any_login_multiple/sign_in', to: 'application#any_login_multiple', as: :sign_in
2
+ post '/any_login_multiple/sign_in', to: 'application#any_login_multiple', as: :any_login_multiple_sign_in
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module AnyLoginMultiple
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.7'
3
3
  end
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.3
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-23 00:00:00.000000000 Z
11
+ date: 2021-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise