I’m trying to render a partial within a view. When calling the render I’m passing :locals correctly. However, when trying to set the local variable in the partial view to a ternary, the ‘else’ logic of the statement does not get passed.
@local_var = passed_var ? passed_var : ”
The ||= operator will not work in this instance for what I’m trying to achieve.
@local_var = ‘wrapping_text_open’ + passed_var + ‘wrapping_text_close’ ||= ”
I never use this, but you could do
Why use an instance variable?