Today I Learned Notes to self about software development

    URL helpers with fragment

    When using a URL helper you can specify a fragment with the anchor option:

    post_path(post.root, anchor: "post_#{post.id}")
    # => "/posts/42#post_69
    

    Previously, I was manually doing something similar like:

    "#{post_path(post.root)}#post_#{post.id}"
    # => "/posts/42#post_69
    
    #rails