Just briefly, why are the following three lines not identical in their impact?
if @controller.controller_name == \"projects\" || @controller.controller_name
The difference is the order of what's happening. Also the || isn't doing what you think it does in the 2 and 3.
You can also do
if ['projects','parts'].include?(@controller.controller_name)
to reduce code in the future if you need to add more matches.