我有兩個關於simple_form rails gem的問題。rails simple_form位掩碼屬性
1.
是否有更好的方法來自動轉換從輸入集合模型靜態數組?
OPTIONS = [:val1,:val2,:val3] #constant from my model:
#for now i'm doing this:
f.collection_radio :model_attribute, MyModel::OPTIONS .collect { |o| [t(o, :scope=>[:activerecord, :attributes, :MyModel]), "#{o}"] }, :last, :first %>
我怎麼能顯示與掩碼屬性複選框? (布魯斯位掩碼)