I see @partial = "workbar_work"
. When render (partial: workbar_work, ...)
is not found, the _workbar_work.html.erb
file. Because it is inside the work folder
$('#workbar_switch').html("<%= j render(partial: "work/#{@partial}", :locals => {exercise: @exercise@}) %>");
or
You can set @partial = "work/#{permitted_params[:partial].to_s}"
$('#workbar_switch').html("<%= j render(partial: @partial, :locals => {exercise: @exercise@}) %>");