mongo_session_store 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +56 -14
  3. data/CHANGELOG.md +12 -2
  4. data/README.md +7 -1
  5. data/gemfiles/rails-4.0-mongo.gemfile +1 -1
  6. data/gemfiles/rails-4.0-mongoid.gemfile +1 -1
  7. data/gemfiles/rails-4.1-mongo.gemfile +1 -1
  8. data/gemfiles/rails-4.1-mongoid.gemfile +1 -1
  9. data/gemfiles/rails-4.2-mongo.gemfile +1 -1
  10. data/gemfiles/rails-4.2-mongoid.gemfile +1 -1
  11. data/gemfiles/rails-5.0-mongo.gemfile +1 -1
  12. data/gemfiles/rails-5.0-mongoid.gemfile +1 -1
  13. data/gemfiles/rails-5.1-mongo.gemfile +9 -0
  14. data/gemfiles/rails-5.1-mongoid.gemfile +9 -0
  15. data/gemfiles/rails-5.2-mongo.gemfile +9 -0
  16. data/gemfiles/rails-5.2-mongoid.gemfile +9 -0
  17. data/lib/mongo_session_store.rb +2 -0
  18. data/lib/mongo_session_store/mongo_store.rb +1 -1
  19. data/lib/mongo_session_store/version.rb +1 -1
  20. data/mongo_session_store.gemspec +2 -1
  21. data/spec/integrations/devise_spec.rb +17 -2
  22. data/spec/rails_helper.rb +4 -1
  23. data/spec/support/apps/rails_4.0_app/app/views/home/index.html.erb +5 -6
  24. data/spec/support/apps/rails_4.1_app/app/views/home/index.html.erb +5 -6
  25. data/spec/support/apps/rails_4.2_app/app/views/home/index.html.erb +3 -4
  26. data/spec/support/apps/rails_5.0_app/app/views/home/index.html.erb +3 -4
  27. data/spec/support/apps/rails_5.1_app/Rakefile +6 -0
  28. data/spec/support/apps/rails_5.1_app/app/controllers/application_controller.rb +3 -0
  29. data/spec/support/apps/rails_5.1_app/app/controllers/home_controller.rb +2 -0
  30. data/spec/support/apps/rails_5.1_app/app/models/application_record.rb +3 -0
  31. data/spec/support/apps/rails_5.1_app/app/models/user.rb +5 -0
  32. data/spec/support/apps/rails_5.1_app/app/views/home/index.html.erb +9 -0
  33. data/spec/support/apps/rails_5.1_app/app/views/layouts/application.html.erb +15 -0
  34. data/spec/support/apps/rails_5.1_app/bin/bundle +3 -0
  35. data/spec/support/apps/rails_5.1_app/bin/rails +4 -0
  36. data/spec/support/apps/rails_5.1_app/bin/rake +4 -0
  37. data/spec/support/apps/rails_5.1_app/bin/setup +34 -0
  38. data/spec/support/apps/rails_5.1_app/bin/update +29 -0
  39. data/spec/support/apps/rails_5.1_app/config.ru +5 -0
  40. data/spec/support/apps/rails_5.1_app/config/application.rb +12 -0
  41. data/spec/support/apps/rails_5.1_app/config/boot.rb +5 -0
  42. data/spec/support/apps/rails_5.1_app/config/database.yml +11 -0
  43. data/spec/support/apps/rails_5.1_app/config/environment.rb +5 -0
  44. data/spec/support/apps/rails_5.1_app/config/environments/development.rb +12 -0
  45. data/spec/support/apps/rails_5.1_app/config/environments/test.rb +19 -0
  46. data/spec/support/apps/rails_5.1_app/config/initializers/devise.rb +254 -0
  47. data/spec/support/apps/rails_5.1_app/config/initializers/session_store.rb +1 -0
  48. data/spec/support/apps/rails_5.1_app/config/locales/en.yml +23 -0
  49. data/spec/support/apps/rails_5.1_app/config/mongo.yml +11 -0
  50. data/spec/support/apps/rails_5.1_app/config/mongoid.yml +13 -0
  51. data/spec/support/apps/rails_5.1_app/config/routes.rb +4 -0
  52. data/spec/support/apps/rails_5.1_app/config/secrets.yml +22 -0
  53. data/spec/support/apps/rails_5.1_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
  54. data/spec/support/apps/rails_5.1_app/db/schema.rb +23 -0
  55. data/spec/support/apps/rails_5.1_app/log/.keep +0 -0
  56. data/spec/support/apps/rails_5.2_app/Rakefile +6 -0
  57. data/spec/support/apps/rails_5.2_app/app/controllers/application_controller.rb +3 -0
  58. data/spec/support/apps/rails_5.2_app/app/controllers/home_controller.rb +2 -0
  59. data/spec/support/apps/rails_5.2_app/app/models/application_record.rb +3 -0
  60. data/spec/support/apps/rails_5.2_app/app/models/user.rb +5 -0
  61. data/spec/support/apps/rails_5.2_app/app/views/home/index.html.erb +9 -0
  62. data/spec/support/apps/rails_5.2_app/app/views/layouts/application.html.erb +15 -0
  63. data/spec/support/apps/rails_5.2_app/bin/bundle +3 -0
  64. data/spec/support/apps/rails_5.2_app/bin/rails +4 -0
  65. data/spec/support/apps/rails_5.2_app/bin/rake +4 -0
  66. data/spec/support/apps/rails_5.2_app/bin/setup +34 -0
  67. data/spec/support/apps/rails_5.2_app/bin/update +29 -0
  68. data/spec/support/apps/rails_5.2_app/config.ru +5 -0
  69. data/spec/support/apps/rails_5.2_app/config/application.rb +12 -0
  70. data/spec/support/apps/rails_5.2_app/config/boot.rb +5 -0
  71. data/spec/support/apps/rails_5.2_app/config/database.yml +11 -0
  72. data/spec/support/apps/rails_5.2_app/config/environment.rb +5 -0
  73. data/spec/support/apps/rails_5.2_app/config/environments/development.rb +12 -0
  74. data/spec/support/apps/rails_5.2_app/config/environments/test.rb +19 -0
  75. data/spec/support/apps/rails_5.2_app/config/initializers/devise.rb +254 -0
  76. data/spec/support/apps/rails_5.2_app/config/initializers/session_store.rb +1 -0
  77. data/spec/support/apps/rails_5.2_app/config/locales/en.yml +23 -0
  78. data/spec/support/apps/rails_5.2_app/config/mongo.yml +11 -0
  79. data/spec/support/apps/rails_5.2_app/config/mongoid.yml +13 -0
  80. data/spec/support/apps/rails_5.2_app/config/routes.rb +4 -0
  81. data/spec/support/apps/rails_5.2_app/config/secrets.yml +22 -0
  82. data/spec/support/apps/rails_5.2_app/db/migrate/20140301171212_add_devise_users.rb +11 -0
  83. data/spec/support/apps/rails_5.2_app/db/schema.rb +23 -0
  84. data/spec/support/apps/rails_5.2_app/log/.keep +0 -0
  85. metadata +139 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4e695507dbe014bf6ce03e55887fb2de88da9374
4
- data.tar.gz: 319e5e0afc4d1ce4617e824ad06ea95382e4ea75
2
+ SHA256:
3
+ metadata.gz: 98a3bc915313a9b027a2c7483dec78a95f193838e48405319d54dcb24938a979
4
+ data.tar.gz: 1236cd6f4cdf7ca4b997a05bd12a749b3ad57ffac50688ddc38935fe959f7dd9
5
5
  SHA512:
6
- metadata.gz: d3e2ffda5285fac66555b713f1647e427c71363774535c151b354c46efe29f085ad823eaca54805f2f6f0cddd11d6d4c6325840a3a5489d996ce9e2efb83904c
7
- data.tar.gz: 97a0faabc0406e2ae1ed252ea842fdddd65d567bb031c408db2e84dd2875eee4e2af247840e7106adc5758d1bbbcd5e0aa5379c744abce389645e51320e09dec
6
+ metadata.gz: 6cabedbc5554f3e0f7b6531191cd2db03a4b9ef45e1d5cc6b4bf49519a93e82618101c1945e089738310480c58fb6e910bf219416b053164751c7da8d8be7e41
7
+ data.tar.gz: f428bfafdea80679efe71b464233b18b32096ab22de94484c0ab1b8625f27f6f127170144c42fe4f9d8fe68c0173c6a6bc762725c08b7f00a63e5c4b5ebb4484
data/.travis.yml CHANGED
@@ -1,11 +1,17 @@
1
+ branches:
2
+ only:
3
+ - master
4
+ - develop
1
5
  language: ruby
2
6
 
3
7
  cache: bundler
4
8
 
5
9
  rvm:
6
10
  - 2.1.10
7
- - 2.3.1
8
- - 2.4.1
11
+ - 2.3.8
12
+ - 2.4.5
13
+ - 2.5.5
14
+ - 2.6.3
9
15
 
10
16
  gemfile:
11
17
  - gemfiles/rails-4.0-mongo.gemfile
@@ -16,29 +22,65 @@ gemfile:
16
22
  - gemfiles/rails-4.2-mongoid.gemfile
17
23
  - gemfiles/rails-5.0-mongo.gemfile
18
24
  - gemfiles/rails-5.0-mongoid.gemfile
25
+ - gemfiles/rails-5.1-mongo.gemfile
26
+ - gemfiles/rails-5.1-mongoid.gemfile
27
+ - gemfiles/rails-5.2-mongo.gemfile
28
+ - gemfiles/rails-5.2-mongoid.gemfile
19
29
 
20
30
  matrix:
21
31
  fast_finish: true
22
32
  include:
23
- - rvm: 2.3.1
24
- gemfile: gemfiles/rails-4.2-mongo.gemfile
33
+ - rvm: 2.5.5
34
+ gemfile: gemfiles/rails-5.2-mongo.gemfile
25
35
  script: bundle exec rubocop
26
- - rvm: 2.3.1
27
- gemfile: gemfiles/rails-4.2-mongo.gemfile
36
+ - rvm: 2.5.5
37
+ gemfile: gemfiles/rails-5.2-mongo.gemfile
28
38
  script: bundle exec danger
29
39
  exclude:
30
- - rvm: 2.4.1
31
- gemfile: gemfiles/rails-4.0-mongo.gemfile
32
- - rvm: 2.4.1
33
- gemfile: gemfiles/rails-4.0-mongoid.gemfile
34
- - rvm: 2.4.1
35
- gemfile: gemfiles/rails-4.1-mongo.gemfile
36
- - rvm: 2.4.1
37
- gemfile: gemfiles/rails-4.1-mongoid.gemfile
38
40
  - rvm: 2.1.10
39
41
  gemfile: gemfiles/rails-5.0-mongo.gemfile
40
42
  - rvm: 2.1.10
41
43
  gemfile: gemfiles/rails-5.0-mongoid.gemfile
44
+ - rvm: 2.1.10
45
+ gemfile: gemfiles/rails-5.1-mongo.gemfile
46
+ - rvm: 2.1.10
47
+ gemfile: gemfiles/rails-5.1-mongoid.gemfile
48
+ - rvm: 2.1.10
49
+ gemfile: gemfiles/rails-5.2-mongo.gemfile
50
+ - rvm: 2.1.10
51
+ gemfile: gemfiles/rails-5.2-mongoid.gemfile
52
+ - rvm: 2.4.5
53
+ gemfile: gemfiles/rails-4.0-mongo.gemfile
54
+ - rvm: 2.4.5
55
+ gemfile: gemfiles/rails-4.0-mongoid.gemfile
56
+ - rvm: 2.4.5
57
+ gemfile: gemfiles/rails-4.1-mongo.gemfile
58
+ - rvm: 2.4.5
59
+ gemfile: gemfiles/rails-4.1-mongoid.gemfile
60
+ - rvm: 2.5.5
61
+ gemfile: gemfiles/rails-4.0-mongo.gemfile
62
+ - rvm: 2.5.5
63
+ gemfile: gemfiles/rails-4.0-mongoid.gemfile
64
+ - rvm: 2.5.5
65
+ gemfile: gemfiles/rails-4.1-mongo.gemfile
66
+ - rvm: 2.5.5
67
+ gemfile: gemfiles/rails-4.1-mongoid.gemfile
68
+ - rvm: 2.5.5
69
+ gemfile: gemfiles/rails-4.2-mongo.gemfile
70
+ - rvm: 2.5.5
71
+ gemfile: gemfiles/rails-4.2-mongoid.gemfile
72
+ - rvm: 2.6.3
73
+ gemfile: gemfiles/rails-4.0-mongo.gemfile
74
+ - rvm: 2.6.3
75
+ gemfile: gemfiles/rails-4.0-mongoid.gemfile
76
+ - rvm: 2.6.3
77
+ gemfile: gemfiles/rails-4.1-mongo.gemfile
78
+ - rvm: 2.6.3
79
+ gemfile: gemfiles/rails-4.1-mongoid.gemfile
80
+ - rvm: 2.6.3
81
+ gemfile: gemfiles/rails-4.2-mongo.gemfile
82
+ - rvm: 2.6.3
83
+ gemfile: gemfiles/rails-4.2-mongoid.gemfile
42
84
 
43
85
  services: mongodb
44
86
 
data/CHANGELOG.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## 3.1.0
3
+ ## (unreleased)
4
4
 
5
- * [#31](https://github.com/mongoid/mongo_session_store/pull/31): Add Rails 5 support - [@tombruijn](https://github.com/tombruijn).
6
5
  * Your contribution here.
7
6
 
7
+ ## 3.2.0
8
+
9
+ * [#32](https://github.com/mongoid/mongo_session_store/pull/32): Add Rails 5.1 support - [@tombruijn](https://github.com/tombruijn).
10
+ * [#36](https://github.com/mongoid/mongo_session_store/pull/36): Add gem specific main error class - [@tombruijn](https://github.com/tombruijn).
11
+ * [#38](https://github.com/mongoid/mongo_session_store/pull/38): Support rails 5.2 - [@tombruijn](https://github.com/tombruijn).
12
+ * [#41](https://github.com/mongoid/mongo_session_store/pull/41): Add Ruby 2.5 and 2.6 support - [@tombruijn](https://github.com/tombruijn).
13
+
14
+ ## 3.1.0
15
+
16
+ * [#31](https://github.com/mongoid/mongo_session_store/pull/31): Add Rails 5.0 support - [@tombruijn](https://github.com/tombruijn).
17
+
8
18
  ## 3.0.0
9
19
 
10
20
  * Drop Ruby 1.8, 1.9 and 2.0 support - [@tombruijn](https://github.com/tombruijn).
data/README.md CHANGED
@@ -11,7 +11,7 @@ MongoSessionStore is a [Rails][rails]-compatible session store for
11
11
  Driver][mongo]. It also allows for custom Mongo session store that works with
12
12
  any (or no!) Mongo ODM.
13
13
 
14
- MongoSessionStore version 3 is compatible with Rails 4.0 through 4.2. For Rails
14
+ MongoSessionStore version 3 is compatible with Rails 4.0 through 5.2. For Rails
15
15
  3 support please check out issue [#17][issue-rails3] for options and let us
16
16
  know if you need support.
17
17
 
@@ -88,6 +88,12 @@ BUNDLE_GEMFILE=gemfiles/rails-4.1-mongo.gemfile bundle exec rake
88
88
  BUNDLE_GEMFILE=gemfiles/rails-4.1-mongoid.gemfile bundle exec rake
89
89
  BUNDLE_GEMFILE=gemfiles/rails-4.2-mongo.gemfile bundle exec rake
90
90
  BUNDLE_GEMFILE=gemfiles/rails-4.2-mongoid.gemfile bundle exec rake
91
+ BUNDLE_GEMFILE=gemfiles/rails-5.0-mongo.gemfile bundle exec rake
92
+ BUNDLE_GEMFILE=gemfiles/rails-5.0-mongoid.gemfile bundle exec rake
93
+ BUNDLE_GEMFILE=gemfiles/rails-5.1-mongo.gemfile bundle exec rake
94
+ BUNDLE_GEMFILE=gemfiles/rails-5.1-mongoid.gemfile bundle exec rake
95
+ BUNDLE_GEMFILE=gemfiles/rails-5.2-mongo.gemfile bundle exec rake
96
+ BUNDLE_GEMFILE=gemfiles/rails-5.2-mongoid.gemfile bundle exec rake
91
97
  ```
92
98
 
93
99
  ### Performance benchmark
@@ -4,6 +4,6 @@ gem "mongo"
4
4
 
5
5
  gem "rails", "~> 4.0.0"
6
6
  gem "devise", "~> 3.5"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongoid"
4
4
 
5
5
  gem "rails", "~> 4.0.0"
6
6
  gem "devise", "~> 3.5"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongo"
4
4
 
5
5
  gem "rails", "~> 4.1.0"
6
6
  gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongoid"
4
4
 
5
5
  gem "rails", "~> 4.1.0"
6
6
  gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongo"
4
4
 
5
5
  gem "rails", "~> 4.2.8"
6
6
  gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongoid"
4
4
 
5
5
  gem "rails", "~> 4.2.8"
6
6
  gem "devise", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.1") ? "3.5.10" : ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongo"
4
4
 
5
5
  gem "rails", "~> 5.0.0"
6
6
  gem "devise", ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -4,6 +4,6 @@ gem "mongoid"
4
4
 
5
5
  gem "rails", "~> 5.0.0"
6
6
  gem "devise", ">= 4.2"
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.3.6"
8
8
 
9
9
  gemspec :path => "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "mongo"
4
+
5
+ gem "rails", "~> 5.1.0"
6
+ gem "devise", ">= 4.2"
7
+ gem "sqlite3", "~> 1.3.6"
8
+
9
+ gemspec :path => "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "mongoid"
4
+
5
+ gem "rails", "~> 5.1.0"
6
+ gem "devise", ">= 4.2"
7
+ gem "sqlite3", "~> 1.3.6"
8
+
9
+ gemspec :path => "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "mongo"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+ gem "devise", "~> 4.6.2"
7
+ gem "sqlite3", "~> 1.3.6"
8
+
9
+ gemspec :path => "../"
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "mongoid"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+ gem "devise", "~> 4.6.2"
7
+ gem "sqlite3", "~> 1.3.6"
8
+
9
+ gemspec :path => "../"
@@ -1,4 +1,6 @@
1
1
  module MongoSessionStore
2
+ class Error < StandardError; end
3
+
2
4
  def self.collection_name
3
5
  @collection_name
4
6
  end
@@ -47,7 +47,7 @@ module ActionDispatch
47
47
  end
48
48
  end
49
49
 
50
- class NoMongoClientError < StandardError; end
50
+ class NoMongoClientError < ::MongoSessionStore::Error; end
51
51
 
52
52
  attr_accessor :_id, :data, :created_at, :updated_at
53
53
 
@@ -1,3 +1,3 @@
1
1
  module MongoSessionStore
2
- VERSION = "3.1.0".freeze
2
+ VERSION = "3.2.0".freeze
3
3
  end
@@ -17,7 +17,8 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency "actionpack", ">= 4.0"
18
18
  s.add_dependency "mongo", "~> 2.0"
19
19
 
20
- s.add_development_dependency "rspec-rails", "~> 3"
20
+ s.add_development_dependency "rspec-rails", "~> 3.6"
21
+ s.add_development_dependency "capybara", "~> 2.15.0"
21
22
  s.add_development_dependency "pry", "~> 0.10"
22
23
  s.add_development_dependency "rake", "~> 11"
23
24
  s.add_development_dependency "rubocop", "0.45.0"
@@ -1,18 +1,33 @@
1
1
  require "rails_helper"
2
2
 
3
+ current_rails_version = Gem::Version.new(Gem.loaded_specs["rails"].version)
4
+ rails_5_version = Gem::Version.new("5.0.0")
5
+ IS_RAILS_5 = current_rails_version > rails_5_version
6
+
3
7
  describe Devise::SessionsController, :type => :request do
8
+ def rails5?
9
+ IS_RAILS_5
10
+ end
11
+
12
+ def prepare_request_params(params)
13
+ params = { :params => params } if rails5?
14
+ params
15
+ end
16
+
4
17
  def create_user
5
- post "/users",
18
+ post "/users", prepare_request_params(
6
19
  "user[email]" => "person@example.com",
7
20
  "user[password]" => "secret",
8
21
  "user[password_confirmation]" => "secret"
22
+ )
9
23
  end
10
24
 
11
25
  def sign_in
12
- post "/users/sign_in",
26
+ post "/users/sign_in", prepare_request_params(
13
27
  "user[email]" => "person@example.com",
14
28
  "user[password]" => "secret",
15
29
  "user[password_confirmation]" => "secret"
30
+ )
16
31
  end
17
32
 
18
33
  def sign_out
data/spec/rails_helper.rb CHANGED
@@ -1,7 +1,10 @@
1
1
  ENV["RAILS_ENV"] = "test"
2
+ rails_version = Gem.loaded_specs["rails"].version.to_s[/^\d\.\d/]
3
+ if Gem.loaded_specs["rails"].version >= Gem::Version.new("5.2")
4
+ require "active_support/message_encryptor"
5
+ end
2
6
  require "spec_helper"
3
7
  require "rails"
4
- rails_version = Gem.loaded_specs["rails"].version.to_s[/^\d\.\d/]
5
8
  require "support/apps/rails_#{rails_version}_app/config/environment"
6
9
  require "rspec/rails"
7
10
 
@@ -1,10 +1,9 @@
1
1
  You are signed
2
2
  <% if user_signed_in? %>
3
- in as <%= current_user.email %>.
4
- <form method="post" action="<%= destroy_user_session_path %>">
5
- <input type="hidden" name="_method" value="delete" />
6
- <input type="submit" value="Sign out" />
7
- </form>
3
+ in as <%= current_user.email %>.
4
+ <%= form_tag destroy_user_session_path, :method => :delete do %>
5
+ <%= button_tag "Sign out" %>
6
+ <% end %>
8
7
  <% else %>
9
- out. <%= link_to "Sign in", new_user_session_path %>
8
+ out. <%= link_to "Sign in", new_user_session_path %>
10
9
  <% end %>
@@ -1,10 +1,9 @@
1
1
  You are signed
2
2
  <% if user_signed_in? %>
3
- in as <%= current_user.email %>.
4
- <form method="post" action="<%= destroy_user_session_path %>">
5
- <input type="hidden" name="_method" value="delete" />
6
- <input type="submit" value="Sign out" />
7
- </form>
3
+ in as <%= current_user.email %>.
4
+ <%= form_tag destroy_user_session_path, :method => :delete do %>
5
+ <%= button_tag "Sign out" %>
6
+ <% end %>
8
7
  <% else %>
9
- out. <%= link_to "Sign in", new_user_session_path %>
8
+ out. <%= link_to "Sign in", new_user_session_path %>
10
9
  <% end %>
@@ -1,10 +1,9 @@
1
1
  You are signed
2
2
  <% if user_signed_in? %>
3
3
  in as <%= current_user.email %>.
4
- <form method="post" action="<%= destroy_user_session_path %>">
5
- <input type="hidden" name="_method" value="delete" />
6
- <input type="submit" value="Sign out" />
7
- </form>
4
+ <%= form_tag destroy_user_session_path, :method => :delete do %>
5
+ <%= button_tag "Sign out" %>
6
+ <% end %>
8
7
  <% else %>
9
8
  out. <%= link_to "Sign in", new_user_session_path %>
10
9
  <% end %>
@@ -1,10 +1,9 @@
1
1
  You are signed
2
2
  <% if user_signed_in? %>
3
3
  in as <%= current_user.email %>.
4
- <form method="post" action="<%= destroy_user_session_path %>">
5
- <input type="hidden" name="_method" value="delete" />
6
- <input type="submit" value="Sign out" />
7
- </form>
4
+ <%= form_tag destroy_user_session_path, :method => :delete do %>
5
+ <%= button_tag "Sign out" %>
6
+ <% end %>
8
7
  <% else %>
9
8
  out. <%= link_to "Sign in", new_user_session_path %>
10
9
  <% end %>
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,2 @@
1
+ class HomeController < ApplicationController
2
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end