Tag: web development ruby on rails

Helpers in Ruby on Rails

numericality This helper validates that your attributes only have numeric values. By default, this will match the possible sign of the first character, followed by an integer or floating point number. To specify that only integer values ​​are allowed, set :only_integer to true. If you set :only_integer to true then the regular expression will be […]

Modifying Existing Migrations in Ruby

Periodically, you will make mistakes when writing migrations. If you’ve already run a migration, you can’t just edit the migration and run it again: Rails will assume it has already run a migration and will do nothing when you run rails db:migrate. You must rollback the migration (using bin/rails db:rollback, for example), edit the migration, […]