active_scaffold :formats do |config|
format_order = Format.find(:all, :select => :format_order, :order => :format_order).collect(&:format_order)
format_order << format_order.size + 1 # I want only implement when new
config.columns = [:name, :format_order]
config.columns[:format_order].form_ui = :select
config.columns[:format_order].options = {
:options => format_order
}
config.list.columns = [:name, :format_order]
end
I want if I new format, format_order will add a number as code (format_order.size + 1) but I don't want implement it for edit. please help me. thanks