Module: Roda::RodaPlugins::RodaTagHelpers

Defined in:
lib/roda/plugins/tag_helpers.rb

Overview

TODO: add documentation here

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

OPTS =

default options

{
  # 
  tags_label_required_str:    '<span>*</span>',
  #
  tags_label_append_str:      ':',
  # the default classes for various form tags. ie: shortcut to automatically add 
  # BS3 'form-control'
  tags_forms_default_class:   '', # 'form-control',
  
}.freeze

Class Method Summary collapse

Class Method Details

.configure(app, opts = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/roda/plugins/tag_helpers.rb', line 31

def self.configure(app, opts = {})
  if app.opts[:tag_helpers]
    opts = app.opts[:tag_helpers][:orig_opts].merge(opts)
  else
    opts = OPTS.merge(opts)
  end
  
  app.opts[:tag_helpers]             = opts.dup
  app.opts[:tag_helpers][:orig_opts] = opts
end

.load_dependencies(app, opts = OPTS) ⇒ Object

Depend on the render plugin, since this plugin only makes sense when the render plugin is used.



27
28
29
# File 'lib/roda/plugins/tag_helpers.rb', line 27

def self.load_dependencies(app, opts = OPTS)
  app.plugin :tags, opts
end