Notes posted by chitra
RSS feed
0 thanks
Link with relative url
By default link_to opens url as absolute if path does not contain http:// or https:// For Ex.
link_to ‘View’, “test123.abc.com/ag/acf”, target: :_blank, title: “Click to open url in a new tab”
Then it’ll open the link with absolute path not only with test123.abc.com/ag/acf.
If link_to path contains http:// then it takes the relative url.
link_to ‘View’, “http://test123.abc.com/ag/acf”, target: :_blank, title: “Click to open url in a new tab”
Now it open the relative url as it contains.