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

Posted by m.u.sheikh on Stack Overflow See other posts from Stack Overflow or by m.u.sheikh
Published on 2010-05-12T17:16:01Z Indexed on 2010/05/12 17:24 UTC
Read the original article Hit count: 186

Filed under:
|
|
|

I am exploring an big controller method, with about 10 or so instance variables. Some of them are set in before_filter methods, and some others inside the method itself. I want to inspect them with puts, but dont want to write all of them out example: puts "var1: #{@var1.inspect}....var15: #{@var15.inspect}"

Is there a generic method that will display all the instance variables with an @ sign set so far in the current method? If not, what is the next best way to inspect all of them at once without having to write all of them in a puts statement?

© Stack Overflow or respective owner

Related posts about rails

Related posts about ruby