我将如何编写这个 if/unless 语句,以便它查找 IF this和UNLESS that?
respond_to do |format|
if @request.save
if @request.product.require_approval ## UNLESS @request.project ##
do stuff...
else
do other stuff...
end
else
format.html { render action: 'new', notice: 'There was an error with your request.' }
format.json { render json: @request.errors, status: :unprocessable_entity }
end
end
提前致谢。