Class: Grapple::Components::SearchForm
- Inherits:
-
HtmlComponent
- Object
- BaseComponent
- HtmlComponent
- Grapple::Components::SearchForm
- Defined in:
- lib/grapple/components/search_form.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
#builder, #columns, #params, #records, #template
Instance Method Summary collapse
Methods inherited from BaseComponent
Constructor Details
This class inherits a constructor from Grapple::Components::BaseComponent
Instance Method Details
#render(*options, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/grapple/components/search_form.rb', line 9 def render(*, &block) = [0] ? [0] : {} form_classes = [form_class] form_path = [:form_path] || {} = [:form_options] || {} [:class] = form_classes.join(' ') html = '' html << template.form_tag(form_path, ) html << template.hidden_field_tag(page_param, 1) # TODO: don't use tables for vertical alignment html << '<table><tr>' render_components(components, , &block).each do |c| html << "<td>#{c}</td>\n" end html << '</tr></table>' html << '</form>' html.html_safe end |