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.
@@ -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 etc as normal and create new actions in a controller:
21
- def cookies_accept
22
- accept_cookies #this calls the threepwood method to allow cookies
23
- redirect_to home_path
24
- end
25
- def cookies_deny
26
- reject_cookies # this calls the threepwood method to remove the fact that the user has accepted cookies
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
 
@@ -11,6 +11,7 @@ module Threepwood
11
11
  if cookies[:threepwood_accepted]
12
12
  @accepted_cookies = true
13
13
  else
14
+ @accepted_cookies = false
14
15
  headers["no-threepwood"] = "true"
15
16
  end
16
17
  end
@@ -1,8 +1,8 @@
1
1
  module Threepwood
2
2
  module Version
3
3
 
4
- MAJOR = 0
5
- MINOR = 8
4
+ MAJOR = 1
5
+ MINOR = 0
6
6
  TINY = 0
7
7
 
8
8
  def self.to_s # :nodoc:
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threepwood
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 8
9
9
  - 0
10
- version: 0.8.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yule