Sha256: 0e5a3f21ee85285bf36ea4965ce7ca55c99224873fbf14c202d25d2121767750

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

module ActiveEnum
  module FormHelpers
    module Formtastic

      def enum_input(method, options)
        raise "Attribute '#{method}' has no enum class" unless enum = @object.class.enum_for(method)
        select_input(method, options.merge(:collection => enum.to_select))
      end

    end
  end
end

Formtastic::SemanticFormBuilder.send :include, ActiveEnum::FormHelpers::Formtastic

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_enum-0.7.0 lib/active_enum/form_helpers/formtastic.rb