Just briefly, why are the following three lines not identical in their impact?
if @controller.controller_name == \"projects\" || @controller.controller_name
I see a lot of people preferring the include? comparison.
I prefer to use the .in? operator. It is much more succinct. And also more readable, since we don't ask questions to the array, we ask questions to the variable you want to ask: On your case, the controller name.
@controller.controller_name.in? ["projects", "parts"]
Or, even better
@controller.controller_name.in? %w[projects parts]