Skip to content

Commit

Permalink
#20 ransack form added
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdilek committed Sep 10, 2013
1 parent 13a97e6 commit 3c7bf81
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/templates/haml/scaffold/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% @search = "" -%>
<% attributes.each { |attribute| @search += "_#{attribute.name}_or" } -%>
.panel.tables
.panel-heading
%i.icon-table.icon-large
Expand All @@ -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
Expand Down

0 comments on commit 3c7bf81

Please sign in to comment.