Skip to content

force_root_path / add_root_path / add_trailing_slash #7

@jaimeiniesta

Description

@jaimeiniesta

Related to the PR I just created for add_trailing_slash, I wanted to propose a change in force_root_path.

I thought it would work more like add_root_path in NormalizeUrl, that is, only converting an empty path into "/", but respecting non-empty paths like /some/dir.

Instead I see that force_root_path completely replaces any path into the root path. In this case I think we should consider also removing the query and fragment:

  • example.com/some/dir#faqs?page=2 -> example.com/

But I'm not sure about that, maybe we should have other options like wipe_query and wipe_fragment.

Or, include add_root_path as in the above explanation, this would convert URLs like:

  • example.com -> example.com/
  • example.com/some/dir -> example.com/some/dir/
  • example.com/some/dir#top?p=2 -> example.com/some/dir/#top?p=2

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions