Skip to content

Commit 4420098

Browse files
committed
Merge pull request #170 from yonpols/fix/camelize-of-controller-name
Camelize correctly controllers whose name has multiple :: in it
2 parents 52b6744 + f67fec1 commit 4420098

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/apipie/extractor.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def apis_from_routes
8686
controller_path, action = route[:controller], route[:action]
8787
next unless controller_path && action
8888

89-
controller = "#{controller_path}_controller".camelize
89+
controller_path = controller_path.split('::').map(&:camelize).join('::')
90+
controller = "#{controller_path}Controller"
9091

9192
path = if /^#{Regexp.escape(api_prefix)}(.*)$/ =~ route[:path]
9293
$1.sub!(/\(\.:format\)$/,"")

0 commit comments

Comments
 (0)