The raise method raises an exception (but you are not calling it
correctly). to print the id you want
puts list.id
As a newcommer I suggest you work right through a good tutorial (such
as railstutorial.org, which is free to use online), that will show you
the basics of Ruby and Rails.