Validate a string in rails? -
how can validate if string? along lines of:
validates :title, format: string
i've discovered in order validate data inputting contains letters (i guess string in instance), can use following code, validates format of title letters, using regex (the stuff between //).
validates :title, format: {with: /[a-za-z]/}
Comments
Post a Comment