Just briefly, why are the following three lines not identical in their impact?
if @controller.controller_name == \"projects\" || @controller.controller_name
|| is also a null coalescing operator, so
"projects" || "parts"
will return the first string that is not null (in this case "projects"), meaning that in the second two examples, you'll always be evaluating:
if @controller.controller_name == "projects"
Firing up irb, you can check that this is happening:
a = "projects"
b = "parts"
a || b
returns projects