modelじゃなくてviewにvalidationをかけたい
下のコードをコピればvalidationが実装できる
html.erb
<%= label_tag :name, 'なまえ (必須)' %>
<input type="text" name="name" id="name" required placeholder='Your name'>
参考
https://qiita.com/oh_rusty_nail/items/e08f6b323d526fab3d55
More than 3 years have passed since last update.
下のコードをコピればvalidationが実装できる
<%= label_tag :name, 'なまえ (必須)' %>
<input type="text" name="name" id="name" required placeholder='Your name'>
参考
https://qiita.com/oh_rusty_nail/items/e08f6b323d526fab3d55
Register as a new user and use Qiita more conveniently