Make user-inputted url into external link in rails

前端 未结 2 1721
忘掉有多难
忘掉有多难 2021-01-14 10:10

I want users to be able to enter a url and then put a link to that url in my view.

Valid inputs could be e.x. https://www.google.com/path, http:/

2条回答
  •  离开以前
    2021-01-14 10:41

    The Domainatrix gem comes highly recommended for validating URLs:

    https://github.com/pauldix/domainatrix

提交回复
热议问题