Module: Backend::KujakuHelper

Defined in:
app/helpers/backend/kujaku_helper.rb

Defined Under Namespace

Classes: Kujaku

Instance Method Summary collapse

Instance Method Details

#kujaku(*args) ⇒ Object

Kujaku 孔雀 Search bar


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/helpers/backend/kujaku_helper.rb', line 23

def kujaku(*args)
  options = args.extract_options!
  url = options[:url] || {}
  name = args.shift || ("#{controller_path}-#{action_name}-" + caller.first.split(/\:/).second).parameterize
  k = Kujaku.new(self, name)
  if block_given?
    yield k
  else
    k.text
  end
  return '' unless k.feathers.any?
  collapsed = current_user.preference("interface.kujakus.#{k.uid}.collapsed", (options.key?(:collapsed) ? !!options[:collapsed] : true), :boolean).value
  render('backend/shared/kujaku', kujaku: k, url: url, collapsed: collapsed, with_form: !options[:form].is_a?(FalseClass))
end