我想包括next if
在這個循環:如何包括一個內嵌循環中的「未來如果」條件
= select_tag :type, options_for_select(Products.statuses.keys.map{ |product_type| [I18n.t("product.#{product_type}"), product_type] }, params[:type])
所以我想的東西如:
Products.statuses.keys.map{ |product_type| next if product_type == "clothes", [I18n.t("product.#{product_type}"), product_type] }
宇如此快速? :) –
快速和正確的! ;)非常感謝你 – Orsay
@SergioTulentsev昨天我對你有同樣的問題!意思是說,在問題出現後幾秒鐘,你就回答了一些問題,我就像是「好嗎?」 :D –