我希望验证image_url属性始终以
开头https://res.yakari.com/myapp/
以下是使用Regexp进行的当前验证
validates_format_of :image_url,
:with => /\Ahttps:\/\/res.yakari.com\/myapp\/\S*\z/i,
:message => "There's something wrong (doesn't begin with https://res.yakari.com/myapp, wrong path, white space inside string...)"
但是它不起作用,我测试了它,它甚至拒绝正确的字符串(以https://res.yakari.com/myapp/开头的那些字符串)
怎么做?