When working with ruby on rails code, what is the conventional way (or most elegant way) to let rails do nothing? For example when debugging and commenting out a line where there has to be a statement:
begin
#some_commented_out_function
rescue => e
[...]
end
Is there a dummy function I quickly can put in instead of the commented out line? What is the convention for this?
Ruby doesn't have a pass
or no-op statement. In your example, that code would work as written, with or without a comment.
If you'd like to make it explicit, a line with just nil
or a comment explaining the method would probably be considered conventional.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With