Ruby Gotcha - PP not printing
So I have been studying Ruby and Ruby on Rails since last year — for a change. I am currently creating my first rails application and stumbled on a very confusing problem — I could not print a line in controller!
In cakePHP, debug() function is one of those tools I could not live without because it easily displays string and arrays in formatted HTML. I was looking something similar in rails and I stumbled on pp method. When I tried it in my controller, nothing shows up! Here is my code:
-
def new
-
@meeting = Meeting.new
-
pp params # I'm trying to display the contents of params to check on the content
-
end
I spent a couple of hours googling, checking my environment if I was using the development environment, used puts, echo, print, p and a lot more googling. When I tried to ask for assistance in the ruby user group, I doubled checked my command line where I run the ruby script/server and AHA!! the data are displayed there! This is my first ruby gotcha.






Recent Comments