【发布时间】:2016-12-02 19:13:44
【问题描述】:
我正在尝试在 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
但它给出了这个错误:
语法错误,意外的 '=' =begin
我正在使用 Rails 5.0。
【问题讨论】:
标签: ruby-on-rails ruby