Sha256: c37be28e3e9b97512bf3560d4eeca202c5c67c6ecc49bf688fbc49fffcbb4846

Contents?: true

Size: 563 Bytes

Versions: 14

Compression:

Stored size: 563 Bytes

Contents

module Fume
  module Formtastic
    
    def self.try_enable
      return unless defined? ::Formtastic
      
      ::Formtastic::SemanticFormBuilder.class_exec do
        alias_method :humanized_attribute_name_without_instance, :humanized_attribute_name
        
        def humanized_attribute_name(method)
          if @object && @object.respond_to?(:human_attribute_name)
            @object.human_attribute_name(method.to_s)
          else
            humanized_attribute_name_without_instance(method)
          end
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fume-0.5.3 lib/fume/formtastic.rb
fume-0.5.2 lib/fume/formtastic.rb
fume-0.5.1 lib/fume/formtastic.rb
fume-0.5.0 lib/fume/formtastic.rb
fume-0.4.3 lib/fume/formtastic.rb
fume-0.4.2 lib/fume/formtastic.rb
fume-0.4.1 lib/fume/formtastic.rb
fume-0.4.0 lib/fume/formtastic.rb
fume-0.3.5 lib/fume/formtastic.rb
fume-0.3.4 lib/fume/formtastic.rb
fume-0.3.3 lib/fume/formtastic.rb
fume-0.3.2 lib/fume/formtastic.rb
fume-0.3.1 lib/fume/formtastic.rb
fume-0.3.0 lib/fume/formtastic.rb