method
handle_model
v4.2.1 -
Show latest stable
- Class:
ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder
handle_model(record)public
No documentation available.
# File actionpack/lib/action_dispatch/routing/polymorphic_routes.rb, line 250
def handle_model(record)
args = []
model = record.to_model
name = if model.persisted?
args << model
model.model_name.singular_route_key
else
@key_strategy.call model.model_name
end
named_route = prefix + "#{name}_#{suffix}"
[named_route, args]
end