redirectr 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. data/lib/redirectr.rb +8 -3
  2. metadata +4 -4
data/lib/redirectr.rb CHANGED
@@ -71,8 +71,8 @@ module Redirectr
71
71
  # Used in back links, referrer based redirection after actions etc.
72
72
  # Accepts a default redirect path in case no param[referrer_param]
73
73
  # is set, default being root_path.
74
- # Can and should be overwritten in namespace specific controllers
75
- # to set a sensible default if no referrer is given.
74
+ # To set an own default path (per controller), you can overwrite
75
+ # the default_path method (see below).
76
76
  # Example:
77
77
  #
78
78
  # class MyController
@@ -100,10 +100,15 @@ module Redirectr
100
100
  unless referrer_path.blank?
101
101
  referrer_path
102
102
  else
103
- root_path
103
+ default || default_path
104
104
  end
105
105
  end
106
106
 
107
+ # to be overwritten by your controllers
108
+ def default_path
109
+ root_path
110
+ end
111
+
107
112
  # Convenience method for params[referrer_param]
108
113
  def referrer_path
109
114
  params[referrer_param]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redirectr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Willem van Kerkhof
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-16 00:00:00 +01:00
18
+ date: 2010-11-25 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21