lib/action_view/helpers/store.rb in extjs-mvc-0.1.6 vs lib/action_view/helpers/store.rb in extjs-mvc-0.1.7

- old
+ new

@@ -30,10 +30,19 @@ if auto_load script += "s.load();" end script += "});" end - "new Ext.data.#{type}Store(#{params[:config].to_json});#{script}" + + if params[:config]["writer"] # <-- ugly hack because 3.0.1 can't deal with Writer as config-param + writer = params[:config].delete("writer") + json = params[:config].to_json + json[json.length-1] = ',' + json += "writer:new Ext.data.#{params[:format].capitalize}Writer(#{writer.to_json})}" + "new Ext.data.#{type}Store(#{json});#{script}" + else + "new Ext.data.#{type}Store(#{params[:config].to_json});#{script}" + end end end end