any_login_multiple 0.1.4 → 0.1.8

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
  SHA256:
3
- metadata.gz: 87e86525fe8b0e35c140afdc41cc609c031e50c8485687e19bf6b6798bf8e9f1
4
- data.tar.gz: 2440c4a9db4d4cccf84b28a399795e11ff0f789775b5f5fcd89248badcaeb646
3
+ metadata.gz: 4245d24b49065d7c790a947d6a5ac128f93ed78e03c80119071e5d52ae75f9c9
4
+ data.tar.gz: d21cc1ae2b897096277ba1c3ad90ae026073e001383b848b64a388d76b9e495f
5
5
  SHA512:
6
- metadata.gz: 9bbe61d9e8cdcf7c926004a9f5695f079923b760909c248bf155b7eabf60fa0774280485dbf606ab1f41f163be59bc410e6a0c28f0cf75f30e5607d25633bdc3
7
- data.tar.gz: 252bd1d009777fe4ee677106251218e18b2961b03adc3951c1021ece085b6c36b42e2cd464cf55ec4cb1188d4910a5cf540e5eebab697199ffb6e292c003caf9
6
+ metadata.gz: 2e3aa1941a3e642610ce1fbc059e7ef7870b931890df7e732759698682961fed006b92ceafadd1c513ad229dffd63155c3ee18f65fbadace205f4616b491ad56
7
+ data.tar.gz: 1886a01916673cd6fd285a551ecb01fc411d7dc3e6cc372fa3eb606daf8b2ee8bfdbc944714c824bf6446e5dba90e5c5f92a465c545087ff6f0403c43c0941c9
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,11 +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) %>
9
+ <%= form.select :id, klass_name.constantize.pluck(:email, :id), include_blank: "Select #{klass_name}" %>
10
10
  <% end %>
11
11
  <% end %>
12
12
  </div>
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.4'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -13,4 +13,3 @@ module AnyLoginMultiple
13
13
  end
14
14
  end
15
15
 
16
- require 'any_login_multiple/routes'
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
4
+ version: 0.1.8
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
@@ -54,7 +54,6 @@ files:
54
54
  - lib/any_login_multiple.rb
55
55
  - lib/any_login_multiple/engine.rb
56
56
  - lib/any_login_multiple/helpers.rb
57
- - lib/any_login_multiple/routes.rb
58
57
  - lib/any_login_multiple/version.rb
59
58
  homepage: https://github.com/kenzo-tanaka/any_login_multiple
60
59
  licenses:
@@ -1,7 +0,0 @@
1
- module ActionDispatch::Routing
2
- class Mapper
3
- def mount_routes
4
- mount AnyLoginMultiple::Engine => '/any_login_multiple', as: 'any_login_multiple'
5
- end
6
- end
7
- end