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
488 def forme_config(form)
489   form.namespaces << forme_namespace
490 end
forme_default_request_method()
[show source]
    # File lib/sequel/plugins/forme.rb
507 def forme_default_request_method
508   'post'
509 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
493 def forme_form_class(base)
494   unless klass = MUTEX.synchronize{FORM_CLASSES[base]}
495     klass = Class.new(base)
496     klass.send(:include, SequelForm)
497     MUTEX.synchronize{FORM_CLASSES[base] = klass}
498   end
499   klass
500 end
forme_input(form, field, opts)

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

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

Use the underscored model name as the default namespace.

[show source]
    # File lib/sequel/plugins/forme.rb
517 def forme_namespace
518   model.send(:underscore, model.name)
519 end
forme_use_required_abbr?()

Whether to set an abbr tag in labels for required inputs.

[show source]
    # File lib/sequel/plugins/forme.rb
512 def forme_use_required_abbr?
513   true
514 end