已存在的数据,执行更新,如果没有存在,则插入数据。
view:
<%=g.d f.select "#{d[:cityid]}-#{d[:device_manu]}",[["",""],["TL1","tl1"],["SNMP","snmp"]], {:selected =>d[:means] }%>
model:
def self.update_collect_means(collect_means)
collect_means.each_pair do |id,means|
update_all("id='#{id}'","means = '#{means}'")
end
end
controller:
def update_collect_means
params[:collect_means].each_pair do |id,means|
unless means.blank?
keys = id.split("-")
#collect_mean = CollectMean.new(:cityid => keys[0],:device_manu => keys[1],:means => "#{means}")
collect_mean = CollectMean.find_or_create_by_cityid_and_device_manu_and_means(:cityid => keys[0], :device_manu => keys[1],:means => "#{means}")
collect_mean.save
end
end
#CollectMean.update_collect_means(params[:collect_means])
flash[:notice] = "更新采集方式成功。"
redirect_to :action => :index
end
分享到:
相关推荐
So just find filename_EN.tex file you want to translate, copy to filename_XX.tex (where XX is your language) and replace English text by yours. No special TeX/LaTeX knowledge is needed. Then just ...
# $(call find-copy-subdir-files,*,device/softwinner/polaris-common/rild/usb_modeswitch.d,system/etc/usb_modeswitch.d) PRODUCT_PROPERTY_OVERRIDES += \ ro.sw.embeded.telephony = false PRODUCT_...
# $(call find-copy-subdir-files,*,device/softwinner/polaris-common/rild/usb_modeswitch.d,system/etc/usb_modeswitch.d) PRODUCT_PROPERTY_OVERRIDES += \ ro.sw.embeded.telephony = false PRODUCT_...
order, columns width, sortmarkers, row height) in/from registry or ini file. Allows to show hint (ToolTips) for text that don't fit in the cell. Allows to export data to Text, Csv, HTML, RTF, XLS ...
Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com) if ((start_addr & NAND_BLOCK_MASK) || (size & NAND_BLOCK_MASK)) { return -1; /* invalid alignment */ } ...
int xx,yy; int chakela; int amd[200][200]; int rmd[200][200]; int gmd[200][200]; int bmd[200][200]; int yanser,yanseg,yanseb; FILE *zuojian; bool keys[256]; // Array Used For The Keyboard Routine ...
P in equation (1), that you can find either x from y or y from x. Note also that both computations can be done incrementally. As the leading characters of y are known, the range of possible x narrows,...
or to skip) by adding * character to the folder string, for example: Personal Folders\Inbox* * Version 1.71 o Fixed OutlookAttachView to be able to scan the public folders of Exchange server. * ...
已经发现的问题是执行 find,不返回 (hd0);精简 PE 加载映像文件死机。 2.解决了FDD 模式的 u 盘,执行 find 时返回 (fd0,n) 的问题。 3.修正了 menu.lst 中 0PE.ISO 的默认位置。 4.usb2.0 驱动通过菜单或...
By default Delphi (5, 6 and 7) places compiled files to the <Delphi path>\Projects\Bpl directory and this directory already present in the search PATH. But if you overwrite default BPL directory ...
order, columns width, sortmarkers, row height) in/from registry or ini file. Allows to show hint (ToolTips) for text that don't fit in the cell. Allows to export data to Text, Csv, HTML, RTF, XLS ...
After you find a framework file you could pull it via adb pull /path/to/file or use a file manager application. After you have the file locally, pay attention to how Apktool installs it. The number ...