Written by Indigo Tech Tutorials
August 13, 2025
1 views
To permit nested attributes in rails 8 with the new .expect method you need to wrap your nested attributes array in a double array. Weirdly enough this will permit the nested attributes. I was confused why my params where not getting permitted and I was getting an empty hash back when trying to save my model with nested records, but I remembered with the new .expect method you must wrap the attributes in 2 arrays like so.
params.expect(user: [:email_address, :password, company: [[:name, :url, :logo]]])
Migrate from Rails built in authentication to Devise Gem
Today I am migrating my app from the rails built in authentication to use the...
The problem with Rails built in authentication generator
The rails authentication generator was added in Rails version 8 and it seemed...
Upgrade Ruby version with Mise
Ruby 3.4.5 was released last month but I had been using 3.4.4 still and now R...
How to backup & restore SQLite3 database with Ruby on Rails 8 & Kamal
Backing up your database is an important thing when you have a website online...
Get a custom tutorial for Ruby on Rails
Do you have an idea to build a website but you don't know where to start? Are...
Ruby on Rails mentorship for $10
This is your opportunity to get exclusive mentorship and guidance with your R...
How to permit nested attributes in Rails 8
To permit nested attributes in rails 8 with the new .expect method you need t...
What will you do before GTA 6 is released?
GTA 6 is a game that is very highly awaited from all gamers. The phrase "We g...
New videos soon