I want to print out some debug messages in my erb template when it is called in development mode, but not when it is called in production mode (i.e.)
<%= debug variable_name %>
However, this will be printed in any mode.
I found I can do
<% if logger.debug?
debug variable_name
end %>
which seems to work. Is this the proper way, or is there a more elegant solution?