Sha256: 2aa681475b37403de4ea02d51b9367c45ec8da16b8f067b66ac8f0bd3846923c
Contents?: true
Size: 616 Bytes
Versions: 27
Compression:
Stored size: 616 Bytes
Contents
module Locomotive class CustomFieldService < Struct.new(:field) # Update the options of a "select" field. # # @param [ Hash ] options It includes the following keys: name, _id and _destroyed (if persisted) # # @return [ Array ] The new list of options # def update_select_options(options) return nil if options.blank? # set the right position options.each_with_index do |option, position| option['position'] = position end self.field.select_options_attributes = options self.field.save self.field.select_options end end end
Version data entries
27 entries across 27 versions & 1 rubygems