if you felt like optimising, you don't use pin_form at all if this happens, so you could move it down below this if... or even into the render and remove the var.