I am considering the following implementation approach:
- Load the Rails application and list the routes.
- Cross-reference the routing list in the Schema file to identify parameter definitions for each route.
- Convert to RBS.
When retrieving typed_params from a Rails controller, we may need to use overloading to identify the calling action.
class UsersController < ApplicationController
def self.typed_params_for: (:index) -> TypedParamsForIndexAction
| (:show) -> TypedParamsForShowAction
end
class UsersController < ApplicationController
def index
typed_params = typed_params_for(:index)
end
def show
typed_params = typed_params_for(:show)
end
end
I am considering the following implementation approach:
When retrieving typed_params from a Rails controller, we may need to use overloading to identify the calling action.