threepwood 0.8.0 → 1.0.0
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.
- data/README.rdoc +18 -9
- data/lib/threepwood/railtie.rb +1 -0
- data/lib/threepwood/version.rb +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -15,20 +15,29 @@ In your gemfile:
|
|
15
15
|
Create a partial saying that your site will use cookies
|
16
16
|
%p
|
17
17
|
This site uses cookies.
|
18
|
-
= link_to 'I accept cookies.', '/cookies_accept'
|
19
|
-
= link_to 'I decline cookies.', '/cookies_deny'
|
20
|
-
Set up routes
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
= link_to 'I accept cookies.', '/cookies_accept', :method => :put
|
19
|
+
= link_to 'I decline cookies.', '/cookies_deny', :method => :put
|
20
|
+
Set up routes:
|
21
|
+
put "cookies_accept" => your_controller#cookies_accept
|
22
|
+
put "cookies_deny" => your_controller#cookies_deny
|
23
|
+
set up controller actions:
|
24
|
+
class YourController < ApplicationController
|
25
|
+
def cookies_accept
|
26
|
+
accept_cookies #this calls the threepwood method to allow cookies
|
27
|
+
redirect_to home_path
|
28
|
+
end
|
29
|
+
def cookies_deny
|
30
|
+
reject_cookies # this calls the threepwood method to remove the fact that the user has accepted cookies
|
31
|
+
redirect_to home_path
|
32
|
+
end
|
27
33
|
end
|
28
34
|
|
29
35
|
On your page (assume HAML):
|
30
36
|
= render :partial => 'your_message_about_cookies' unless @accepted_cookies
|
31
37
|
|
38
|
+
Alternatively add a static html page that proceeds your web app and call accept_cookies in a before filter on application_controller
|
39
|
+
OR add a message to your terms and conditions and add accept_cookies to your login action
|
40
|
+
|
32
41
|
|
33
42
|
== License
|
34
43
|
|
data/lib/threepwood/railtie.rb
CHANGED
data/lib/threepwood/version.rb
CHANGED
metadata
CHANGED