Skip to content

Commit ec5dc27

Browse files
kevinmarxiNecas
authored andcommitted
use underscore when appending controller to the default controller
string. calling camelize on a namespaced controller will result in Api::Mycontroller instead of Api::MyController
1 parent a40c4a0 commit ec5dc27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/apipie/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def rails_routes(route_set = nil)
5555
# this method does in depth search for the route controller
5656
def route_app_controller(app, route, visited_apps = [])
5757
if route.defaults[:controller]
58-
controller_name = (route.defaults[:controller] + 'Controller').camelize
58+
controller_name = "#{route.defaults[:controller]}_controller".camelize
5959
controller_name.safe_constantize
6060
end
6161
end

0 commit comments

Comments
 (0)