Just briefly, why are the following three lines not identical in their impact?
if @controller.controller_name == \"projects\" || @controller.controller_name
the exact semantics of || are:
so what your first expression works out to is, if @controller.controller_name == "projects", then the expression short-circuits and returns true. if not, it checks the second expression. the second and third variants are essentially if @controller.controller_name == "projects", since "projects" || "parts" equals "projects". you can try this in irb:
>> "projects" || "parts"
=> "projects"
what you want to do is
if ["projects", "parts"].include? @controller.controller_name