JC: added @erb_code to controller and @type when params[:id] is present. spec passes.