Closed ymdarudy closed 2 years ago
validates :url, format: /\A#{URI::regexp(%w(http https))}\z/
https://blog.bitarts.jp/entry/2015/09/14/rails_url_validate.html https://morizyun.github.io/ruby/active-record-validation.html#URL%E3%81%AE%E3%83%90%E3%83%AA%E3%83%87%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3
validates :url, format: /\A#{URI::regexp(%w(http https))}\z/
https://blog.bitarts.jp/entry/2015/09/14/rails_url_validate.html https://morizyun.github.io/ruby/active-record-validation.html#URL%E3%81%AE%E3%83%90%E3%83%AA%E3%83%87%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3