Is there a way to check all controller variables at once in Rails?

I am learning a large controller method with about 10 instance variables. Some of them are set in the before_filter methods and some others inside the method itself. I want to test them with puts, but I don't want to write all of them:

puts "var1: #{@var1.inspect}....var15: #{@var15.inspect}"

Is there a generic method that displays all the instance variables with the sign @set so far in the current method? If not, what is the next best way to check everything at once without writing them to the puts statement?

+3
source share

Source: https://habr.com/ru/post/1745146/


All Articles