有時候我一直在頭撞牆。不知道爲什麼我甚至在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