Optional Parameters in View Partials
It’s generally good practise to pass variables to view partials using locals rather than littering your code with @variables. This allows better reuse of the partial. To make the locals optional, provide default values if they are nil or undefined. I have seen many recommendations to do this with a test for defined? According to […]