有时候我一直在头撞墙。不知道为什么我甚至在collection_select()上出现语法错误时,我确信它是正确的。请帮助铁路2.1.1。ROR-语法错误
<%= f.collection_select (:location_id, Location.find(:all), :id, :name, :prompt => true,
{:onchange => remote_function(
:url => {:action => "loc_selected", :controller => "location",
:id=> location.id},
:with => "'location_id='+this.value")}) %>
编译错误
C:/Users/Tau/rails_proj/incident/app/views/events/_general_step.html.erb:35:语法错误,意想不到的 ')',期望tASSOC ...“'location_id ='+ this.value”)})).to_s); _erbout.concat“\ n ...
请格式化您的代码缩进它4个空格。此外,您是否使用haml或erb? – jergason 2010-12-08 22:14:56