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
467 def forme_config(form)
468   form.namespaces << forme_namespace
469 end
forme_default_request_method()
[show source]
    # File lib/sequel/plugins/forme.rb
486 def forme_default_request_method
487   'post'
488 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
472 def forme_form_class(base)
473   unless klass = MUTEX.synchronize{FORM_CLASSES[base]}
474     klass = Class.new(base)
475     klass.send(:include, SequelForm)
476     MUTEX.synchronize{FORM_CLASSES[base] = klass}
477   end
478   klass
479 end
forme_input(form, field, opts)

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

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

Use the underscored model name as the default namespace.

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