Ruby有阻止评论吗?
如果没有,是否有一种有效的方法插入#TextMate中突出显示的代码块之前?
在RubyMine的很容易与代码编写出来的HTML - >在线评论,但你对此有何评论中的红宝石多行.
%= "this is a test %>
至
#= "this is a test %>
我试图在Rails 5控制器中评论多行,我搜索了网络并找到了以下解决方案:"= begin"
=begin (Multiple lines)
respond_to do |format|
if @person.update_attributes(params[:person])
flash[:notice] = 'Person was successfully updated.'
format.html { redirect_to(@person) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @person.errors, :status => :unprocessable_entity }
end
end
=end
Run Code Online (Sandbox Code Playgroud)
但它给出了这个错误:
语法错误,意外'='=开始
我正在使用Rails 5.0.