module ActiveModel::Naming

def self.route_key(record_or_class)

such cases, automatically appends _index.
The route key also considers if the noun is uncountable and, in

ActiveModel::Naming.route_key(Blog::Post) # => "blog_posts"
# For shared engine:

ActiveModel::Naming.route_key(Blog::Post) # => "posts"
# For isolated engine:

namespaced models regarding whether it's inside isolated engine.
Returns string to use while generating route names. It differs for
def self.route_key(record_or_class)
  model_name_from_record_or_class(record_or_class).route_key
end