February 2019
Intermediate to advanced
240 pages
5h 25m
English
We know that, having configured our Rails app to talk to our Postgres database, our Rails app started successfully; however, we’re relying on the absence of an error as proof that the database is connected correctly. While, technically, that’s all we need, let’s make sure it’s working as expected by interacting with the database from our app. This will also give us more practice at developing our Rails app with Docker, via the Compose CLI.
Let’s generate a basic UsersController in our Rails app. For the sake of speed, we’re going to just use Rail’s generate scaffold command:
| | $ docker-compose exec web \ |
| | bin/rails g scaffold User first_name:string last_name:string |
| | invoke ... |
Read now
Unlock full access