Class: Backend::KujakuHelper::Kujaku::TextFeather

Inherits:
Feather
  • Object
show all
Defined in:
app/helpers/backend/kujaku_helper.rb

Overview

Text feather permits full text search

Instance Attribute Summary

Attributes inherited from Feather

#uid

Instance Method Summary collapse

Methods inherited from Feather

#feather_name, feather_name, inherited, #initialize, #inspect

Constructor Details

This class inherits a constructor from Backend::KujakuHelper::Kujaku::Feather

Instance Method Details

#configure(*_args) ⇒ Object


82
83
84
# File 'app/helpers/backend/kujaku_helper.rb', line 82

def configure(*_args)
  @name = @options.delete(:name) || :q
end

#to_htmlObject


86
87
88
89
90
91
92
93
94
# File 'app/helpers/backend/kujaku_helper.rb', line 86

def to_html
  p = @template.current_user.pref("kujaku.feathers.#{@uid}.default", @template.params[@name])
  @template.params[@name] ||= p.value
  p.set!(@template.params[@name])
  html = @template.(:label, @options[:label] || :search.tl)
  html << ' '.html_safe
  html << @template.text_field_tag(@name, @template.params[@name])
  html
end