<% type = case care_goal when LabResult then "result" else care_goal.class.name.underscore end %> <%= render partial: type, locals: {type => care_goal} %>