session_rememberable 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -2
- data/lib/session_rememberable/methods.rb +2 -0
- data/lib/session_rememberable/version.rb +1 -1
- data/lib/session_rememberable.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8f7b7985641e7d69ddf12cdb30bf50918ba25dd8d033f9a76efe0c5a3c9e04
|
4
|
+
data.tar.gz: 59756b4ba60d8b3fb48778a737d5c7bbb102c19221b642bdf4e52b07ccf1f82c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 449119f42850fe46c085294504d1dcb8d60e0cc7ec9bc4605eb68106e65d17a9e7e018b9941f200d2eab7b63ce2ee6ee3978be4d7bdd443007ff0ae937bf7b29
|
7
|
+
data.tar.gz: 5153d44f00f313b5a1543118b5baa1e3b2c2cc8c08bdaa88e7c7ec7840e1f383a34842a1331160617fa9fddf38fd97364365a8717f3704124fdb1944c12a60a5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -41,7 +41,7 @@ class CustomersController < ApplicationController
|
|
41
41
|
customer = User.new(permitted_params)
|
42
42
|
|
43
43
|
if customer.save
|
44
|
-
|
44
|
+
remember customer
|
45
45
|
redirect_to customer
|
46
46
|
else
|
47
47
|
render :new
|
@@ -52,7 +52,7 @@ class CustomersController < ApplicationController
|
|
52
52
|
customer = User.find(params[:id])
|
53
53
|
|
54
54
|
if customer.destroy
|
55
|
-
|
55
|
+
forget customer
|
56
56
|
redirect_to root_path
|
57
57
|
else
|
58
58
|
render :edit
|
@@ -74,3 +74,15 @@ In your views (.html.haml)
|
|
74
74
|
Welcome
|
75
75
|
= current_customer.name
|
76
76
|
```
|
77
|
+
|
78
|
+
## Initializer
|
79
|
+
|
80
|
+
`config/initializers/session_store.rb`
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
Rails.application.config.session_store SessionRememberable::Store, {
|
84
|
+
rememberable_options: {
|
85
|
+
permanent: true
|
86
|
+
}
|
87
|
+
}
|
88
|
+
```
|
data/lib/session_rememberable.rb
CHANGED