2015-04-18から1日間の記事一覧
検証 validates フィールド名, 検証用ハッシュオブジェクト 存在:presence 長さ:length 存在してるか class Post < ActiveRecord::Base validation :title, :presence => true end #Error post = Post.new(title: "aaa", body: "validation") post = Post.…
検証 validates フィールド名, 検証用ハッシュオブジェクト 存在:presence 長さ:length 存在してるか class Post < ActiveRecord::Base validation :title, :presence => true end #Error post = Post.new(title: "aaa", body: "validation") post = Post.…