[TIL Tips] How to speed up the DNS expiring process after you DNS change
This might be the easiest-simpler tip ever. Just visit Google Public DNS Cache Flush and input your website URL.
Simple, yet useful.…
Read more ⟶[TIL Tips] How to force existing column to contain data in Rails
First, create an empty migration, either by hand or using bin/rails g. Then use the change_column_null handle:
class FieldNullOnModel < ActiveRecord::Migration[5.1] def change change_column_null :table_name, :column_name, false end end Save the changes and migrate (bin/rails db:migrate). Voila! The target column now requires content. Remember to update existing records to reflect this validation.…
Read more ⟶[TIL Tips] How to add extra fields during user registration with Devise
Let’s use the ’twitter clone’ example from the rails tutorial. The Twitter registration is different, because it not only requires an email and password but also a username. Here is how you can add this extra field to your code:
First, let’s import the default devise views into our project:
rails g devise:views This will create a folder in app/views/devise/ containing all the views required for (including the ones for registration that we will modify).…
Read more ⟶