focused_controller 2.0.0 → 2.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/focused_controller/route_mapper.rb +3 -3
- data/lib/focused_controller/version.rb +1 -1
- data/test/unit/route_mapper_test.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50328909d601965e71fb57ca5bbd7b1018388643
|
4
|
+
data.tar.gz: 2b620c4a51d034a1b4d2ddcad005c7ef32831e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172bf02aabc5827c994fe2e6f5354bc83c9dda4f00db222dbd0360fde8e977dd08f955116ec10058339cb559491b860bb030f1bf8ffa7e77a3618c0c74b2c44c
|
7
|
+
data.tar.gz: 121d5d4ce59ad2f3866f380542fb617ee372abc4b177a9b8c2a8556e3ee82db0e3c451e60315007714a130e04e4617cb1b13f8583bc5761df59fd9a638e481f3
|
data/CHANGELOG.md
CHANGED
@@ -25,14 +25,14 @@ module FocusedController
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def to_option
|
28
|
-
if @options[:
|
28
|
+
if @options[:controller]
|
29
|
+
@options[:controller]
|
30
|
+
elsif @options[:to] && !@options[:to].respond_to?(:call)
|
29
31
|
if @options[:to].include?('#')
|
30
32
|
stringify_controller_and_action(*@options[:to].split('#'))
|
31
33
|
else
|
32
34
|
@options[:to]
|
33
35
|
end
|
34
|
-
elsif @options[:controller]
|
35
|
-
@options[:controller]
|
36
36
|
elsif @options[:action] && @scope[:controller]
|
37
37
|
stringify_controller_and_action(@scope[:controller], @options[:action])
|
38
38
|
end
|
@@ -24,8 +24,9 @@ module FocusedController
|
|
24
24
|
it 'creates routes that map to focused controllers' do
|
25
25
|
route_set.draw do
|
26
26
|
focused_controller_routes do
|
27
|
-
get 'posts'
|
28
|
-
get 'posts/all'
|
27
|
+
get 'posts' => 'PostsController::Index'
|
28
|
+
get 'posts/all' => 'posts#index'
|
29
|
+
get 'posts/all2' => 'PostsController::Index'
|
29
30
|
|
30
31
|
resources :comments do
|
31
32
|
resources :replies
|
@@ -55,6 +56,7 @@ module FocusedController
|
|
55
56
|
[:get, '/comments/a/omg'] => 'PostsController::Index',
|
56
57
|
[:get, '/comments/b/omg'] => 'CommentsController::Index',
|
57
58
|
[:get, '/admin/foo'] => 'Admin::FooController::Show',
|
59
|
+
[:get, '/posts/all2'] => 'PostsController::Index',
|
58
60
|
}
|
59
61
|
|
60
62
|
mappings.each do |(method, path), controller|
|