diff --git a/lib/templates/haml/scaffold/index.html.haml b/lib/templates/haml/scaffold/index.html.haml index e735690..0e455f8 100644 --- a/lib/templates/haml/scaffold/index.html.haml +++ b/lib/templates/haml/scaffold/index.html.haml @@ -1,3 +1,5 @@ +<% @search = "" -%> +<% attributes.each { |attribute| @search += "_#{attribute.name}_or" } -%> .panel.tables .panel-heading %i.icon-table.icon-large @@ -10,19 +12,20 @@ %a.btn{href: '#'} %i.icon-filter Filters - %a.btn{href: '#', data: {toggle: 'toolbar-tooltip'}, title: 'Reload'} + %a.btn{href: <%= index_helper %>_path, data: {toggle: 'toolbar-tooltip'}, title: 'Reload'} %i.icon-refresh - .badge 3 record + .badge= @<%= plural_table_name %>.total_entries .panel-body.no-padding .table-header.row .col-lg-9 TODO: Add filters here .col-lg-3 - .input-group - %input.form-control{placeholder: 'Quick search...', type: 'text'}/ - %span.input-group-btn - %button.btn{type: 'button'} - %i.icon-search + = search_form_for @search, builder: SimpleForm::FormBuilder do |f| + .input-group + = f.input_field :<%= @search[1..@search.size-4] %>_cont, label: false, input_html: {class: 'form-control'}, placeholder: 'Quick search...' + %span.input-group-btn + = button_tag( class: 'btn') do + %i.icon-search %table.table %thead %tr