Here is one way to center a fixed-width/fixed-height div at the center of its container. This could be adapted to centering text, images, etc. within their containers. Essentially, we do a bit of arithmetic to get the fixed-sized element centered using absolute positioning and margins. Note that the parent container must have a `position: relative` property for this to work.
Re-initializing a table sequence is quite normal and required in some cases. I had to do that recently. If the table has data and needs to be preserved, then temporarily you have to move the data, delete the data in original table and re-initialize the sequence and copy the original data again. Let's see how to re-initialize table sequence in PostgreSQL.
There comes a time when you need to load data from multiple sources to futher processing in your application. Let's see how we can do this with ease in this post and load data from multiple files in Ruby using Hash.
The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. Learn a way to add close buttons to flash messages in Rails templates.
A traditional Rails application uses a single application. We interact with it by writing models that inherit from `ActiveRecord::Base` which translate connection details (from config/database.yml) via the method `establish_connection`. Let's see how to connect to multiple databases from a Rails app.