
felipem
Agile Web Development with Rails 7: fields with errors are not highlighted (page 86)
The following screenshot shows what happens if we try to submit a new product with none of the fields filled in. Try it by visiting http://localhost:3000/products/new and submitting the form without entering any data. It’s pretty impressive: the fields with errors are highlighted, and the errors are summarized in a nice list at the top of the form.
The fields with errors are not highlighted in the screenshot and neither in the app itself at this point. Also shadows in all screenshots are rendered as a weird mobile-webkit-like outline that ignores the rounded corner’s border radius.
First Post!

rubys
sigh. That used to work. The book has been updated to say:
By adding a bit of css, we can also highlight the fields with errors in red. Place
the following code in app/assets/stylesheets/field_with_errors.css:
.field_with_errors :is(input, textarea, select) {
border: solid red 2px !important;
}
If we try again, the result is more impressive.
Popular Pragmatic Bookshelf topics










Other popular topics









Latest in Agile Web Development with Rails 7
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /ash
- /vscode
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /scala
- /zig
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /react-native
- /sublime-text
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /lua
- /nodejs
- /c
- /slackware
- /julia
- /neovim