zh_kostev_ext 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,7 @@ module ControllerExtensions
|
|
2
2
|
module GeneralMethods
|
3
3
|
def self.included(base)
|
4
4
|
base.class_eval do
|
5
|
-
const_set(:REDIRECT_DEFAULT_PATH, '/')
|
6
|
-
after_filter :store_location
|
5
|
+
const_set(:REDIRECT_DEFAULT_PATH, '/') unless const_defined?(:REDIRECT_DEFAULT_PATH)
|
7
6
|
#Load resource or redirect to 404 if can't load resource. Used as before filter.
|
8
7
|
#
|
9
8
|
# Example:
|
@@ -40,6 +39,7 @@ module ControllerExtensions
|
|
40
39
|
end
|
41
40
|
|
42
41
|
#redirects to back.
|
42
|
+
#!IMPORTANT to use this method you should add after_filter to your application_controller(after_filter :store_location)
|
43
43
|
# You can specify REDIRECT_DEFAULT_PATH constant in ActionController::Base to setup default redirect path(by default REDIRECT_DEFAULT_PATH='/')
|
44
44
|
#
|
45
45
|
# You can also pass params to redirect to method
|
@@ -52,7 +52,6 @@ module ControllerExtensions
|
|
52
52
|
redirect_to url
|
53
53
|
end
|
54
54
|
|
55
|
-
private
|
56
55
|
#stores request path if request is get and not ajax
|
57
56
|
#
|
58
57
|
# Example
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zh_kostev_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
segments:
|
138
138
|
- 0
|
139
|
-
hash:
|
139
|
+
hash: 1018968851
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
141
|
none: false
|
142
142
|
requirements:
|