This blog is part of our Rails 6 series.
Rails 6.0 was recently released.
Rails 6 added
This works the same way as
It extracts the nested value specified by the sequence of keys.
was introduced in
Before Rails 6, we can achieve the same thing by first converting session to a hash
and then calling
Let’s checkout how it works.
Let’s add some user information in session and use dig after converting it to a hash.
Let’s add the same information to session and now use
dig on session object
without converting it to a hash.
Here is the relevant