module Sequel::Plugins::Forme::InstanceMethods

  1. lib/sequel/plugins/forme.rb

Public Instance methods

forme_config (form)

Configure the form with support for Sequel::Model specific code, such as support for nested attributes.

[show source]
    # File lib/sequel/plugins/forme.rb
479 def forme_config(form)
480   form.namespaces << forme_namespace
481 end
forme_default_request_method ()
[show source]
    # File lib/sequel/plugins/forme.rb
499 def forme_default_request_method
500   'post'
501 end
forme_form_class (base)

Return subclass of base form that includes the necessary Sequel form methods.

[show source]
    # File lib/sequel/plugins/forme.rb
484 def forme_form_class(base)
485   unless klass = MUTEX.synchronize{FORM_CLASSES[base]}
486     klass = Class.new(base)
487     klass.send(:include, SequelForm)
488     klass.send(:include, ERBSequelForm) if defined?(::Forme::ERB::Form) && base == ::Forme::ERB::Form
489     MUTEX.synchronize{FORM_CLASSES[base] = klass}
490   end
491   klass
492 end
forme_input (form, field, opts)

Return Forme::Input instance based on the given arguments.

[show source]
    # File lib/sequel/plugins/forme.rb
495 def forme_input(form, field, opts)
496   SequelInput.new(self, form, field, opts).input
497 end
forme_namespace ()

Use the underscored model name as the default namespace.

[show source]
    # File lib/sequel/plugins/forme.rb
504 def forme_namespace
505   model.send(:underscore, model.name)
506 end